Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7809 吴承熹 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 676 2025-05-24 09:47:52

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,x=INT_MIN,m=INT_MAX; cin>>n; int a[11][11]; 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]>x){ x=a[i][j]; } if(a[i][j]<m){ m=a[i][j]; } } } cout<<m<<" "<<x; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:13: error: 'INT_MIN' was not declared in this scope
     int n,x=INT_MIN,m=INT_MAX;
             ^
Main.cc:21:24: error: 'm' was not declared in this scope
             if(a[i][j]<m){
                        ^
Main.cc:26:11: error: 'm' was not declared in this scope
     cout<<m<<" "<<x;
           ^