Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2820 林子杰 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 425 2024-03-02 17:54:29

Tests(0/0):


Code:

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


Run Info:

Main.cc:3:17: error: 'INT_MAX' was not declared in this scope
 int a[9][9],Min=INT_MAX,Max=INT_MIN;
                 ^
Main.cc: In function 'int main()':
Main.cc:13:24: error: 'Max' was not declared in this scope
             if(a[i][j]>Max)Max=a[i][j];
                        ^
Main.cc:16:25: error: 'Max' was not declared in this scope
         cout<Min<<" "<<Max<<endl;
                         ^