Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
159397 张晓冉 二维数组最大值 C++ Compile Error 0 MS 0 KB 422 2026-08-29 15:11:56

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int m(int a[3][4]){ int max = a[0][0]; for(int i = 0;i < 3;i++){ for(int j = 0;j < 4;j++){ if(a[i][j] > m){ m = a[i][j]; } } } return max; } int main(){ int a[3][4]; for(int i = 0;i < 3;i++){ for(int j = 0;j < 4;j++){ cin>>a[i][j]; } int s = m(a); cout<<s<<endl; }


Run Info:

Main.cc: In function 'int m(int (*)[4])':
Main.cc:7:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
          if(a[i][j] > m){
                       ^
Main.cc:8:16: error: assignment of function 'int m(int (*)[4])'
              m = a[i][j];
                ^
Main.cc:8:16: error: cannot convert 'int' to 'int(int (*)[4])' in assignment
Main.cc: In function 'int main()':
Main.cc:22:1: error: expected '}' at end of input
 }
 ^