```
#include<iostream>
using namespace std;
int a[30],n,m;
int sum=0,maxx=0,minn=10;
int x=0;
void stat(int a[],int &m){
sum=0,maxx=0,minn=10;
for(int j=0;j<m;j++){
if(maxx<a[j])maxx=a[j];
if(minn>a[j])minn=a[j];
sum+=a[j];
}
sum-=minn;
sum-=maxx;
if(x<sum)x=sum;
}
int main( )
{
cin>>n>>m;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++)
cin>>a[j];
stat(a,m);
}
printf("%.2lf",(double)x/(m-2));
}
```
@[Zzy20060323](/user/1423008)
by sunjunyi1017 @ 2024-10-06 15:38:44