20分求助!
查看原帖
20分求助!
510360
HbugU楼主2021/5/8 19:45
#include<bits/stdc++.h>
using namespace std;
int n,m;
double maxn=-1,sum=0,a[10005];;
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>a[j];
			sum+=a[j];
		}
		sort(a+1,a+1+m);
		sum=sum-a[1]-a[m];
		sum/=(m-2);
		maxn=max(sum,maxn);
	}
	printf("%.2lf",maxn);
	return 0;
} 

  
2021/5/8 19:45
加载中...