- #include
- int main()
- {
- float arr[3][4], max;
- int i, j, row, colum; //row为行数,colum为列数
- for (i = 0; i <= 2; i++)
- {
- for (j = 0; j <= 3; j++)
- {
- printf("请输入arr[%d][%d]\n",i,j);
- scanf("%f",&arr[i][j]);
- }
- }
- max = arr[0][0];
- for (i = 0; i <= 2; i++)
- {
- for (j = 0; j <= 3; j++)
- {
- if (max
- {
- max = arr[i][j];
- row = i;
- colum = j;
- }
- }
- }
- printf("这个矩阵的最大值为 % f, 行数为 % d, 列数为 % d",max,row,colum);
- return 0;
- }