Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128334 吴雨卓 序列变换 C++ Compile Error 0 MS 0 KB 202 2025-08-15 08:59:29

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:7: error: 'n' was not declared in this scope
 int a[n],b[n];
       ^
Main.cc:6:7: error: 'a' was not declared in this scope
  cin>>a[i];
       ^
Main.cc:8:2: error: 'b' was not declared in this scope
  b[i]=a[a[i]];
  ^
Main.cc:8:7: error: 'a' was not declared in this scope
  b[i]=a[a[i]];
       ^
Main.cc:10:8: error: 'b' was not declared in this scope
  cout<