Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146530 孔声豪 15听到多少次掌声 C++ Compile Error 0 MS 0 KB 410 2026-01-29 11:58:08

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a,b,d,t,cnt: bool n=false; t=0; a=b=d+cnt=1; while(a+b+d<30){ t++; n=false; if(a<10){ n=true; a++; } if(b<10&&t%2==0){ n=true; b++; } if(d<10&&t%4==0){ n=true; d++; } if(n) cnt++; } cout<<cnt<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:4:18: error: expected initializer before ':' token
   int a,b,d,t,cnt:
                  ^
Main.cc:7:11: error: 'cnt' was not declared in this scope
     a=b=d+cnt=1;
           ^
Main.cc:10:5: error: 'n' was not declared in this scope
     n=false;
     ^