输入:
3 5 -1 4
7 -32 0 9
-102 45 78 4
输出:
max=78 maxr=2 maxc=2
#include <stdio.h>
#define ROW 3
#define COL 4
int FindMaxbyRow(int (*p)[COL],int row,int col,int *maxRow,int *maxCcol);
int main(void)
{
int a[ROW][COL];
int max,maxr,maxc;
int i,j;
for(i=0;i<ROW;i++)
{
for(j=0;j<COL;j++)
scanf("%d",&a[i][j]);
}
2分
printf("max=%d maxr=%d maxc=%d\n",max,maxr,maxc);
return 0;
}
int FindMaxbyRow(int (*p)[COL],int row,int col,int *maxRow,int *maxCcol)
{
int i,j;
int max;
2分
*maxRow=0;
*maxCcol=0;
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
if(2分
)
{
2分
*maxRow=i;
*maxCcol=j;
}
}
}
2分
}