1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| # 输入评委人数 n
n = int(input())
# 输入 n 个评分,并将其转换为浮点数列表
scores = list(map(float, input().split()))
# 计算所有评分的总和
total = sum(scores)
# 找到最高分
max_score = max(scores)
# 找到最低分
min_score = min(scores)
# 计算去掉最高分和最低分后的平均分
average = (total - max_score - min_score) / (n - 2)
# 输出最终得分,保留两位小数
print("{:.2f}".format(average))
|