Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
139413 刘益梵 二维数组的最大值与最小值 C++ Compile Error 0 MS 0 KB 440 2025-12-06 16:55:08

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int a[10][10]; int main(){ int n; scanf("%d",&n); for(int i=1;i<n;i++){ for(int j=1;j<=n;j++){ scanf("%d",&a[i][j]); } } int max = a[1][1];//假设最大值 int min = a[1][1];//假设最小值 for(int i=1;i<=n;j++){ for(int j=1;j<=n;j++){ if(a[i][j]>max) max = a[i][j]; if(a[i][j]<min) min = a[i][j]; } } printf("%d %d\n",min,man); return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:14:19: error: 'j' was not declared in this scope
  for(int i=1;i<=n;j++){
                   ^
Main.cc:20:23: error: 'man' was not declared in this scope
  printf("%d %d\n",min,man);
                       ^
Main.cc:6:16: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
                ^
Main.cc:9:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&a[i][j]);
                        ^