求助,看好久找不出问题
查看原帖
求助,看好久找不出问题
1561369
ppwy楼主2024/11/21 23:32
#include <iostream>
using namespace std;

int main(){
	int n,m;
	cin >> n >> m;
	int wy[20] = {0},maxn = -1,minn = 11,maxcount = 0;
	while(n--){
		int count = 0;
		for(int i = 0;i<m;i++){
			cin >> wy[i];
			if(wy[i] > maxn) maxn = wy[i];
			if(wy[i] < minn) minn = wy[i];
			count += wy[i];
		}
		count -= maxn + minn;	
		if(count > maxcount) maxcount = count;
	}
	double ppy = maxcount/(m-2);
	cout << fixed << setprecision(2) << ppy;
	
	return 0;
}
2024/11/21 23:32
加载中...