水题,求平均数
#include <stdio.h> int main() { //freopen("D:\\t.txt", "r", stdin); int n; while (scanf("%d", &n) != EOF && n != 0) { int i; int xmin, xmax, sum; scanf("%d", &xmin); xmax = xmin; sum = xmin; for (i = 1; i < n; i++) { int a; scanf("%d", &a); sum += a; if (xmin > a) xmin = a; if (xmax < a) xmax = a; } printf("%d\n", (sum - xmin - xmax) / (n - 2)); } return 0; }