Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121357 刘子锐 18成绩修改 C++ Compile Error 0 MS 0 KB 280 2025-06-07 12:00:45

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int i; cin >> i; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int b, c; cin >> b >> c; a[b - 1] = c; for (int i = 0; i <= n - 1; i++) { cout << a[i] << " "; return 0; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:8: error: 'n' was not declared in this scope
  int a[n];
        ^
Main.cc:8:10: error: 'a' was not declared in this scope
   cin >> a[i];
          ^
Main.cc:12:2: error: 'a' was not declared in this scope
  a[b - 1] = c;
  ^