#include
using namespace std;
const int M = 3;
const int N = 5;
void max_min(int a[][N])
{
int i,j;
cout << "每行的最大值和小值分别是:"<< endl;
int max,min;
for(i=0;i max=min=a[i][0];
for(j=1;j if(a[i][j] if(a[i][j]>max) max=a[i][j];
}
cout << "第" << i+1 << "行:" << max << " " << min << endl;
}
cout << "每列的最大值和最小值分别是:"<< endl;
for(j=0;j max=min=a[0][j];
for(i=1;i if(a[i][j] if(a[i][j]>max) max=a[i][j];
}
cout << "第" << j+1 << "列:" << max << " " << min << endl;
}
}
int main()
{
int a[M][N];
int i,j;
for(i=0;i for(j=0;j cin >> a[i][j];
}
}
max_min(a);
system("pause");
return 0;
}