程序是这样的:
#include<iostream>
using namespace std;
int main()
{
int i,j;
int a[3][4]={{1,2,3,4},{5,6,7,8},{9,10,11,12}};
int max[3]={0};
for(i=0;i<3;i++)
{
for(j=0;j<4;j++)
{
if(a[i][j]>max[i])
{
max[i]=a[i][j];
}
}
}
cout<<max[i]<<" ";
cout<<endl;
}