A-A+

以下和程序中 主函数调用了lineMax函数 实现在N行M列的二维数组中 找出每一行上的最大

2022-08-12 19:04:38 问答库 阅读 197 次

问题详情

以下和程序中,主函数调用了lineMax函数,实现在N行M列的二维数组中,找出每一行上的最大值,请填空。 define N 3 define M 4 void lineMax(int x[N][M]) {int i,j,p; for(i=0;i<N;i+ +) { p=0; for(j=1;j<M;j+ +) if(x [i][p]<x[i][j]【 】 ; printf("The max value in line is %dn",【 】 ); } { main() {int x[N][M]={1,5,4,2,6,4,3,8,2,3,1}; 【 】 ; }


请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:p=jx[i][p]lineMax(x)
p=jx[i][p]lineMax(x)

考点:函数,程序