#include <stdio.h> int main() { int sum = 0; int min = 100; //假设最低分为100 int max = 0; //假设最高分为0 int arr[7] = { 0 }; //整型数组输入 for (int i = 0; i < 7; i++) { scanf("%d", &arr[i]); if (arr[i] > max) { max = arr[i]; } if (arr[i] < min) { min = arr[i]; } sum += arr[i]; } double avg = (sum - max - min) / 5.0; //输出 printf("%.2lf\n", avg); return 0; }