鹅,做了半天还是不对,所以来请各位神牛们帮帮我。随机关注帮我的大牛们。祝你们AK NOI!
#include<bits/stdc++.h>
#include<algorithm>
#define MAXN 108
#define MAXP 28
using namespace std;
int n,m;
int a[MAXP];
double defen[MAXN];
int main(){
cin>>n>>m;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
cin>>a[j];
defen[i]+=a[j];
sort(a,a+m);
defen[i]-=a[0];
defen[i]-=a[m-1];
defen[i]=defen[i]/(m-2);
}
}
sort(defen,defen+n);
printf("%.2f\n",defen[n-1]);
return 0;
}