Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
128774 罗迎甲 杀人游戏 C++ Compile Error 0 MS 0 KB 527 2025-08-19 15:59:57

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,i,t=0,s=0,r=0; cin>>n>>m; while(r!=n-1){ t++; if(t>n)t=1; if(!a[t])s++; if(s==m){ s=0; cout<<t<<" "; a[t]=1; r++; } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:13: error: 'a' was not declared in this scope
         if(!a[t])s++;
             ^
Main.cc:17:13: error: 'a' was not declared in this scope
             a[t]=1;
             ^
Main.cc:8:13: warning: unused variable 'i' [-Wunused-variable]
     int n,m,i,t=0,s=0,r=0;
             ^