答案
2024-08-16 15:28:37
发布于:北京
10阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int n, m, a[20][20], mx[20], mn[20];
int main(){
cin >> n >> m;
for(int i = 1; i <= m; i++){
mn[i] = 110;
}
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cin >> a[i][j];
if(a[i][j] > mx[j]) mx[j] = a[i][j];
if(a[i][j] < mn[j]) mn[j] = a[i][j];
}
}
for(int i = 1; i <= m; i++){
cout << mx[i] << " ";
}
cout << endl;
for(int i = 1; i <= m; i++){
cout << mn[i] << " ";
}
return 0;
}
全部评论 5
顶
2024-08-16 来自 北京
0不过找我
2024-08-16 来自 北京
0#include<bits/stdc++.h> using namespace std; int n, m, a[20][20], mx[20], mn[20]; int main(){ cin >> n >> m; for(int i = 1; i <= m; i++){ mn[i] = 110; } for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++){ cin >> a[i][j]; if(a[i][j] > mx[j]) mx[j] = a[i][j]; if(a[i][j] < mn[j]) mn[j] = a[i][j]; } } for(int i = 1; i <= m; i++){ cout << mx[i] << " "; } cout << endl; for(int i = 1; i <= m; i++){ cout << mn[i] << " "; } return 0; }
2024-08-16 来自 北京
0呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜
2024-08-16 来自 北京
0555555555555555555555555
2024-08-16 来自 北京
0
有帮助,赞一个