#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <iostream>
#include <locale.h>
#include <time.h>
using namespace std;

int main()
{
	setlocale(0, "");
	const int n = 15;
	int sum = 0;
	int arr1[n];
	int a;
	int b; int max; int min;
	int nom_max, nom_min;

	do

	{
		cout << "Ââåäiòü à = "; cin >> a;
		cout << "Ââåäiòü b = "; cin >> b;

	} while (a >= b);
	srand(time(NULL));
	for (int i = 0; i < n; i++)
	{
		arr1[i] = rand() % (b-a)+a;
		if (i % 5 == 0) printf("\n");
		printf("%5d", arr1[i]);
	}
	printf("\n");
	for (int i = 0; i < n; i++)
	{
		if (arr1[i] < 0)
			sum += arr1[i];
	}
	
	max = min = arr1[0];
	nom_max = nom_min = 0;
	for (int m = 1; m < n; m++)
	{
		if (max < arr1[m]) 
		{
				max = arr1[m];
				nom_max = m;	
		}
		if (min > arr1[m]) 
		{
				min = arr1[m];
				nom_min = m;	
		}
		
	}
	printf("\nmin = arr[%i] = %i", nom_min,min);
	printf("\nmax = arr[%i] = %i", nom_max,max);
	
	if (nom_min > nom_max)
	{
		int tmp = nom_max;
		nom_max = nom_min;
		nom_min = tmp;
	}
	
	int q = 1;
	for (int i = nom_min + 1; i < nom_max-1; i++) 
	{
		q *= arr1[i];
	}
	printf("\n\näîáóòîê = %i", q);

	_getch();
	return 0;
}
