#include
#include
int main()
{
int n=1,i,min,max;
double num;//总数
double ave;
while(scanf("%d",&n)!=EOF)
{
if(n==0)
break;
int p[n+1];
num=0;
for(i=0; i { scanf("%d",&p[i]); num+=p[i]; if(i==0) { min=p[0]; max=p[0]; } else { if(min>p[i]) min=p[i]; if(max
max=p[i]; } } ave=(num-max-min)/(double)(n-2); printf("%d,%d,%.1lf\n",min,max,ave); } }
#include
int main(void){
while(1){
int buffer[100];
int max,min,sum;
float average;
printf("plaese input your data:\n"); //input number amount to stdin
scanf("%d",&buffer[0]);
if(0==buffer[0]) //if 0 qiut
break;
for(int i=1;iscanf("%d",&buffer[i]);
if(i==1){
max=buffer[1];
min=max;
sum=max; //set inite value
}
else{
if(maxmax=buffer[i];
if(min>buffer[i])
min=buffer[i];
sum+=buffer[i];
}
}
sum-=(max+min); //sub max & min
average=(float)sum/buffer[0];
printf("sum = %d max = %d min = %d average = %f\n",sum,max,min,average);
//output
fflush(stdin); //clear stdin
}
getchar();
return 0;
}