#include
float fun(float a[],int n,float &max,float *min)
{int i;
float s=a[0];
max=*min=a[0];
for(i=1;i{if(a[i]>max)max=a[i];
else if(a[i]<*min)*min=a[i];
s+=a[i];
}
return (s-max-*min)/(n-2);
}
int main()
{int i,n;
float av,a[100],max,min;
scanf("%d",&n);
for(i=0;iscanf("%f",&a[i]);
av=fun(a,n,max,&min);
printf("Max=%f\nMin=%f\nAv=%f\n",max,min,av);
return 0;
}
float fun(float a[],int n,float &max,float *min)
{
float sum = max = *min = a[0];
for(int i=1; i{
if(a[i]>max) max = a[i];
if(a[i]<*min) *min = a[i];
sum += a[i];
}
return sum/n;
}