p143 5.5.cpp
来自「谭浩强 《C++ 程序设计》第三版的部分课后练习题源码」· C++ 代码 · 共 27 行
CPP
27 行
#include<iostream>
using namespace std;
int main()
{ int a[3][4],colum=0,row=0;
int i,j,max;
cout<<"please input the numbers: ";
for(i=0;i<3;i++)
for(j=0;j<4;j++) cin>>a[i][j];
max=a[0][0];
for(i=0;i<3;i++)
for(j=0;j<4;j++)
{ if(max<a[i][j]) { max=a[i][j];
row=i; colum=j;
}
}
for(i=0;i<3;i++)
{ for(j=0;j<4;j++) cout<<a[i][j]<<" ";
cout<<endl;
}
cout<<"the biggest number is "<<max<<endl;
cout<<"the row= "<<row<<" the colum="<<colum;
system("pause");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?