程序代码:
#include <stdio.h> int f(int s[][4],int row,int col,int* rerow,int* recol) { int max=0; for(int i=0;i<row;i++) { for(int j=0;j<col;j++) { if(s[i][j]>=max) { max=s[i][j]; *rerow=i+1; *recol=j+1; } } } return max; } int main() { int s[4][4]={{1,2,3,4},{44,33,22,11},{25,305,45,15},{9,8,7,6}}; int row=0; int col=0; int max=f(s,4,4,&row,&col); printf("mxa= %d row= %d col=%d \n",max,row,col); return 0; }
[此贴子已经被作者于2019-1-10 10:08编辑过]
DO IT YOURSELF !