主()
{ int max,maxi,maxj,min,mini,minj,a[3][4],I,j;
printf("輸入數字:\ n ');
for(i=0,i & lt3;i++)
for(j = 0;j & lt4;j++)
scanf("%d ",& ampa[I][j]);
max = min = a[0][0];
for(i=0,i & lt3;i++)
for(j = 0;j & lt4;j++)
{ if(a[I][j]& gt;最大)
{ max = a[I][j];
maxi = I+1;
maxj = j+1;
}
if(a[I][j]& lt;最小)
{ min = a[I][j];
mini = I+1;
minj = j+1;
}
}
Printf("最大值是%d,在第%d行,第%d列;\n最小值是%d,在第%d行,第% d列,\ n ",max,maxi,maxj,min,mini,minj);
}
滿意,請采納!