- 打分
666
- @ 2026-7-6 17:02:50
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int n;
cin >> n;
int a = 0, m = 0, x = 10;
int s;
for (int i = 0; i < n; i++)
{
cin >> s;
a += s;
if (s > m) m = s;
if (s < x) x = s;
}
// 去掉一个最高分、一个最低分,计算平均分
double g = (a - m - x) * 1.0 / (n - 2);
// 保留2位小数输出
cout << f << setprecision(2) << g << endl;
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 1361
- 时间
- ms
- 内存
- MiB
- 难度
- 2
- 标签
- 递交数
- 278
- 已通过
- 104
- 上传者