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