题解 | #公务员面试#
公务员面试
https://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97
#include <stdio.h>
int main() {
int a[6],max=-1,min=1000,i=0,sum=0;
double aver;
while((scanf("%d ",&a[i]))!=EOF)
{
if(a[i]>max)
{
max=a[i];
}
if(a[i]<min)
{
min=a[i];
}
sum+=a[i];
i++;
if(i==7)
{
i=0;
aver=(sum-max-min)/5.0;
printf("%.2f\n",aver);
getchar();//吸收\n
sum=0;
aver=0.0;
}
}
return 0;
}