#include <stdio.h>
#include <math.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
int main()
{
int a[100];
int i, j, n, min, max, ind, sum;
float ch;
char flag;
printf("Vvedite razmer vectora n=");
scanf("%d",&n);
for (i=0; i<n; i++)
{
printf("a[%d]=",i);
scanf("%d", &a[i]);
}
min = a[0];
max = min;
ind = 0;
for (i = 0; i < n; i++)
if (min > a[i])
{
min = a[i];
ind=i;
}
if (max < a[i]) max = a[i];
printf("\n Min element = %d", min);
printf("\n Index min elementa = %d \n", ind);
max = a[0];
for (i = 0; i < n; i++)
if (max < a[i]) max = a[i];
printf("\n Max element = %d \n", max);
flag = 0;
for(i=ind+2; i<n; i++)
{
if(a[i-1] < a[i])
{
flag = 1;
break;
}
}
sum = 0 ;
if(flag==0)
for(i=0; i<ind; i++)
sum = sum + a[i];
ch = (float)min / max;
printf("\n Summa elementov do min = %d \n", sum);
printf("\n Chastnoe min / max = %f \n", ch);
for (i=0; i<n; i++)
printf("%2d", a[i]);
}