Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128784 罗迎甲 猴子选大王 C++ Compile Error 0 MS 0 KB 546 2025-08-19 16:33:08

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m,t=0,s=0,r=0; bool a[100]={0}; cin>>n>>m; while(r!=n-1){ t++; if(t>n)t=1; if(!a[t])s++; if(s==m){ s=0; a[t]=1; r++; } } else cout<<a[s]; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:22:5: error: 'else' without a previous 'if'
     else 
     ^