- #include"picture.h"//加入绘图头文件
- int main()
- inta[3][4]=((1,2,3,4},{5,6,7,8},{-10,-3,-4,4}}:
- int Row=0,Co1um=0,MAX=a[0][0];//假设a[0][0]为最大值
- for (int i=0;i<=2;i++)
- //用二重循环,一重循环枚举行
- for (int j=0;j<=3;j++)
- //一重循环枚举列
- if (a[i][]>MAX)
- MAX=a [i][];
- //更新为更大值
- Row=i
- //更新为最大值所在的行
- Colum=j;
- //更新为最大值所在的列
- cout<<"最大值为"<<MAX<<"\n";
- Cout<<"行数为"<<Row+1<<"\n";
- cout<<"列数为"<<Colum+1<<"\n";
- win.Show ()