#include
int main()
{
int a[3][4], maxnum, minnum, maxx, maxy, minx, miny;
int i,j;
for (i = 0; i < 3; i++)
{
for (j = 0; j < 4; j++)
scanf("%d",&a[i][j]);
}
maxnum = minnum = a[0][0];
maxx = maxy = minx = miny = 0;
for (i = 0; i < 3; i++)
{
for (j = 0; j < 4; j++)
{
if (a[i][j] > maxnum)
{
maxnum = a[i][j];
maxx = i;
maxy = j;
}
else if (a[i][j] < minnum)
{
minnum = a[i][j];
minx = i;
miny = j;
}
}
}
printf("maxnum = %d, place: %d, %d\n", maxnum,maxx,maxy);
printf("minnum = %d, place: %d, %d\n", minnum,minx,miny);
}
//输入12个数至一个二维数组a[3][4]中,输出最大值和最小值及其所在的位置。
//用大学一年级c语言编,越简单越好
#include
using namespace std;
int main(){
int a[3][4];
int minx=0,miny=0,maxx=0,maxy=0;
int max=a[0][0],min=a[0][0];
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
if(max if(min>a[i][j]{minx=i;miny=j;}
}
}
cout<<"max="<
return 0;
}