Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133396 鲁博睿 18排列骨头 C++ Compile Error 0 MS 0 KB 647 2025-10-18 16:54:00

Tests(0/0):


Code:

#include <bits/stdc++.h> ? using namespace std; int a[31]; int main() { int cut=0; //取出的个数 int i=1; //位置 int ss=1; //数数 while(cut<15){ if(a[i] == 0){ //没有取出来的位置报数 ss++; if(ss==9){ //如果这个位置刚好数到9 a[i] = 1; //被取出 cnt++; //取出的次数加一 ss=0; } } i++; //每次循环位置往后移动 if(i>30) i = 1; //超过最大位置,从新从第一个开始 } //最后遍历一遍,看看任然为0的元素,说明没有被取出 for(int j=1;j<=30;j++){ if(a[j]==0){ cout<<j<<" "; } } return 0; }


Run Info:

Main.cc:1:26: warning: extra tokens at end of #include directive
 #include  ?
                          ^
Main.cc: In function 'int main()':
Main.cc:13:5: error: 'cnt' was not declared in this scope
     cnt++; //取出的次数加一 
     ^