```c
记录最大平均分即可
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
float res = -1;
while (n--) {
float t = 0, minNum = 100, maxNum = -1;
float ans = 0;
for (int i = 0; i < m; i++) {
cin >> t;
ans += t;
// 记录最大值和最小值
minNum = min(t, minNum), maxNum = max(t, maxNum);
}
// 去掉两个最值
ans -= minNum + maxNum;
// 求平均分
ans /= m - 2.0;
// 更新最大的平均分
res = max(ans, res);
}
// 输出答案
printf("%.2f", res);
return 0;
}
```
by LHXLZMWJH @ 2023-02-07 21:14:02
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,m,maxm,minm,summ,k;
double maxn=-1,s;
cin>>n>>m;
for (int i=0;i<n;i++) {
maxm=-1,minm=11,summ=0;
for (int j=0;j<m;j++) {
cin>>k;
summ+=k;
if (k>maxm) maxm=k;
if (k<minm) minm=k;
}
s=(summ-maxm-minm)*1.0/(m-2);
if (s>maxn) maxn=s;
}
printf("%.2lf",maxn);
}
```
by tabelog_AFO @ 2023-02-07 21:17:29
@[LHXLZMWJH](/user/751046) @[tabelog](/user/922589) 人家在求助,不是让你发题解。
by srds_cbddl @ 2023-02-07 23:09:12