Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
154873 张宇泽 19按规则查找数组中的数据 C++ Compile Error 0 MS 0 KB 221 2026-05-31 11:00:27

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:6: error: 'inti' was not declared in this scope
  for(inti=1;i<=m;i++){
      ^
Main.cc:10:13: error: 'i' was not declared in this scope
  for(inti=1;i<=m;i++){
             ^