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

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ int a,b,d,t,cnt: bool n=false; t=cnt=0; a=b=d=1; while(a+b+c<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:6:7: error: 'cnt' was not declared in this scope
     t=cnt=0;
       ^
Main.cc:8:11: error: 'c' was not declared in this scope
 while(a+b+c<30){
           ^
Main.cc:10:5: error: 'n' was not declared in this scope
     n=false;
     ^