#include <stdio.h>
int main()
{
int a[3][4]={{1,2,3,4},{2,3,4,5},{3,4,5,6}};
int i,j,row,colum,max;
max=a[0][0];
for(i=0;i<3;i++){
for(j=0;j<4;j++){
if(a[i][j]>max){
max=a[i][j];
row=i;
colum=j;
}
}
}
printf("max=%d,row=%d,colum=%d",max,row,colum);
return 0;
}
C语言 数组——找出二维数组中最大元素及其行列号
最新推荐文章于 2024-04-13 20:51:08 发布