题解 | #公务员面试#
公务员面试
http://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97
#include<stdio.h>
int main()
{
int arr[7],sum,max,min;
float avr;
while(scanf("%d",&arr[0])!=-1)
{
sum=arr[0];
max=arr[0];
min=arr[0];
for(int i=1;i<7;i++)
{
scanf("%d",&arr[i]);
if(arr[i]>max)
max=arr[i];
if(arr[i]<min)
min=arr[i];
sum+=arr[i];
}
avr=(sum-max-min)/5.0;
printf("%.2f\n",avr);
}
return 0;
}