查找二维数组中的最大值及其行列下标

#include <stdio.h>
#define ROW 3
#define COL 4
int FindMaxbyCol(int *q,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 FindMaxbyCol(int *q,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 分

}

max=FindMaxbyCol(a[0],ROW,COL,&maxr,&maxc);
max=q[0];
q[i * col+j]>max
max=q[i * col+j];
return max;

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632