Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63534 孙诗皓 猴子选大王 C++ Compile Error 0 MS 0 KB 1114 2024-01-13 17:42:37

Tests(0/0):


Code:

#include<iostream> #include<cstring> #include<algorithm> using namespace std; int main(){ int n,m,ge=0,xu=0,bao=1; cin>>n>>m; int a[n+1]; for(int i=1;i<=n;i++) a[i]=1; while(ge!=n-1) { xu++; if(xu==n+1) xu=1; if(a[xu]==0) continue; if(bao==m) { a[xu]=0; bao=0; ge++; } bao++; }#include<iostream> #include<cstring> #include<algorithm> using namespace std; int main(){ int n,m,ge=0,xu=0,bao=1; cin>>n>>m; int a[n+1]; for(int i=1;i<=n;i++) a[i]=1; while(ge!=n-1) { xu++; if(xu==n+1) xu=1; if(a[xu]==0) continue; if(bao==m) { a[xu]=0; bao=0; ge++; } bao++; } for(int i=1;i<=n;i++) { if (a[i]==1) cout<<i; } return 0; } for(int i=1;i<=n;i++) { cout<<a[i]<<" "; } return 0; }


Run Info:

Main.cc:25:6: error: stray '#' in program
     }#include 
      ^
Main.cc: In function 'int main()':
Main.cc:25:7: error: 'include' was not declared in this scope
     }#include 
       ^
Main.cc:25:23: error: expected primary-expression before '>' token
     }#include 
                       ^
Main.cc:28:1: error: expected primary-expression before 'using'
 using namespace std;
 ^
Main.cc:29:11: error: a function-definition is not allowed here before '{' token
 int main(){
           ^
Main.cc:61:1: error: expected '}' at end of input
 }
 ^