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