//N×N数组,每行最大值
#include <iostream>
using namespace std;
const int MS = 3;
int main()
{
int arr[MS][MS];
for (int i = 0; i < MS; i++){
for (int j = 0; j < MS; j++){
cin >> arr[i][j];
}
}
int t;
for (int i = 0; i < MS; i++) {
t = arr[i][0];
for (int j = 0; j < MS; j++) {
if (arr[i][j] > t)
t = arr[i][j];
}
cout << t<<"\t";
}
}
版权声明:本文为weixin_52603463原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。