题解 | #公务员面试#
公务员面试
https://www.nowcoder.com/practice/f3a134908d5b41869f14f58307008a97
#include<stdio.h> int main() { int score=0,max=0,min=100,sum=0,i=0; float aver=0; while(scanf(" %d",&score)!=EOF){ sum+=score;//先计算七门课程总和 if(score>max) max=score; if(score<min) min=score; i++; if(!(i%7)){ sum-=(max+min); aver=sum/5.00; printf("%.2f\n",aver); //再次初始化 sum=0; max=0; min=100; getchar(); } } return 0; }