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