Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112716 李昊宇 18成绩修改 C++ Compile Error 0 MS 0 KB 305 2025-03-10 20:18:44

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a[100] int n,c,ch; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>c>>ch; if(a[i]==c){ for(int i=1;i<=n-1;i++){ cout<<a[i]; } } cout<<a[i]; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:5: error: expected initializer before 'int'
     int n,c,ch;
     ^
Main.cc:6:10: error: 'n' was not declared in this scope
     cin>>n;
          ^
Main.cc:8:14: error: 'a' was not declared in this scope
         cin>>a[i];
              ^
Main.cc:10:10: error: 'c' was not declared in this scope
     cin>>c>>ch;
          ^
Main.cc:10:13: error: 'ch' was not declared in this scope
     cin>>c>>ch;
             ^
Main.cc:11:8: error: 'a' was not declared in this scope
     if(a[i]==c){
        ^
Main.cc:11:10: error: 'i' was not declared in this scope
     if(a[i]==c){
          ^
Main.cc:16:11: error: 'a' was not declared in this scope
     cout<