Th
2024-02-03 12:54:01
发布于:广东
6阅读
0回复
0点赞
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 105;
int n;
int mx = 0, mn = N;
int t, sum;
int mxf, mnf;
int main(){
cin >> n;
for(int i = 1; i <= n; i++){
mxf = 0;
mnf = N;
for(int j = 1; j <= 3; j++){
cin >> t;
sum += t;
mxf = max(mxf, t);
mnf = min(mnf, t);
}
sum -= mxf + mnf;
mn = min(mn, mxf);
mx = max(mx, mnf);
}
printf("%d %d %.1f", mn, mx, sum * 1.0 / n);
return 0;
}
这里空空如也
有帮助,赞一个