Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151094 马俊潇 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 455 2026-04-04 15:53:39

Tests(0/0):


Code:

#include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int a[100][100]={},n,m=0,x=1000000000; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } if(a[i][j]>m){ m=a[i][j];} if(a[i][j]<x){ x=a[i][j];} cout<<x<<" "<<m; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:14:6: error: 'i' was not declared in this scope
 if(a[i][j]>m){
      ^
Main.cc:14:9: error: 'j' was not declared in this scope
 if(a[i][j]>m){
         ^
Main.cc:16:10: error: 'i' was not declared in this scope
     if(a[i][j]