#include<stdio.h> int main() { int sum = 0; int score = 0; int max = 0; int min = 100; for (int i = 0; i < 7; i++) { scanf("%d", &score); sum += score;//读取值的同时求和 if (score > max) { max = score;//重置并舍弃最大值 } if (score < min) min = score;//重置并舍弃最小值 } printf("%.2f\n", (sum - max - min) / 5.0);//%.2f是两位小数 return 0; }