#include <stdio.h>
void swap(int *a, int *b) {
int t;
t = *a;
*a = *b;
*b = t;
}
void bubble_sort(int num[], int n) {
int i, j;
for (i = 0; i < n - 1; ++ i) {
for (j = i + 1; j < n; ++ j) {
if (num[i] > num[j]) {
swap(num + i, num + j);
}
}
}
}
int
main(int argc, char **argv) {
int n, i, temp = 0;
int score[105];
double average;
while (scanf("%d", &n) == 1) {
temp = 0;
average = 0.0;
for (i = 0; i < n; ++ i)
scanf("%d", &score[i]);
bubble_sort(score, n);
for (i = 1; i < n - 1; ++ i) {
temp += score[i];
}
average = (double)temp / (n - 2);
printf("%.2lf\n", average);
}
return 0;
}
HDU2014 青年歌手大奖赛_评委会打分
最新推荐文章于 2021-04-08 15:54:45 发布