Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
122467 王梓轩 18成绩插入 C++ Compile Error 0 MS 0 KB 266 2025-06-20 19:40:43

Tests(0/0):


Code:

#include<iostream> using namespace tsd; int main() { int a[110],b,x; cin>>b; for(int i=1;i<=b;i++) { cin>>a[i]; } for(int i=b;i>=1;i--) { a[i+1]=a[i]; } cin>>x; a[1]=x; for(int i=1;i<=b+1;i++) { cout<<a[i]<<" "; } return 0; }


Run Info:

Main.cc:2:17: error: 'tsd' is not a namespace-name
 using namespace tsd;
                 ^
Main.cc:2:20: error: expected namespace-name before ';' token
 using namespace tsd;
                    ^
Main.cc: In function 'int main()':
Main.cc:6:2: error: 'cin' was not declared in this scope
  cin>>b;
  ^
Main.cc:6:2: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:19:3: error: 'cout' was not declared in this scope
   cout<