[请教]矩阵最值解法
include<stdio.h>void main()
{
int a[2][3];
int i,j,row1,row2,colum1,colum2,max,min;
for(i=0;i<2;i++)
for(j=0;j<3;j++)
{
printf("enter the array:\n");
scanf("%d",&a[i][j]);
}
for(i=0;i<2;i++)
for(j=0;j<3;j++)
max=min=a[0][0];
{if(a[i][j]>max) {max=a[i][j]; row1=i;colum1=j; }
if(a[i][j]<min) {min=a[i][j]; row2=i;colum2=j; }
}
printf("the max is %d,in row %d,colum %d\n",max,row1,colum1);
printf("the min is %d,in row %d,colum %d\n",min,row2,colum2);
}