Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61954 余长乐 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 305 2023-12-16 15:09:54

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int min=99999,max=0; int a[10][10],n; cin>>n; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin>>a[i][j]; } } if(a[i][j]>max){ max=a[i][j]; } if(a[i][j]<min){ min=a[i][j]; } cout<<min<<' '<<max; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:7: error: 'i' was not declared in this scope
  if(a[i][j]>max){
       ^
Main.cc:12:10: error: 'j' was not declared in this scope
  if(a[i][j]>max){
          ^
Main.cc:15:7: error: 'i' was not declared in this scope
  if(a[i][j]