Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2818 邓程允 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 434 2024-03-02 17:52:33

Tests(0/0):


Code:

# include<iostream> using namespace std; int main(){ int a; int b[9][9],Min=INT_MAX,Max=INT_MIN; cin>>a; for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ cin>>b[i][j]; } } for(int i=0;i<a;i++){ for(int j=0;j<a;j++){ if(b[i][j]>Max)Max=b[i][j]; if(b[i][j]<Min)Min=b[i][j]; } } cout<<Min<<" "<<Max<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:21: error: 'INT_MAX' was not declared in this scope
     int b[9][9],Min=INT_MAX,Max=INT_MIN;
                     ^
Main.cc:15:24: error: 'Max' was not declared in this scope
             if(b[i][j]>Max)Max=b[i][j];
                        ^
Main.cc:19:21: error: 'Max' was not declared in this scope
     cout<Min<<" "<<Max<<endl;
                     ^