Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146506 孔声豪 15相同数的次数 C++ Compile Error 0 MS 0 KB 196 2026-01-29 11:06:30

Tests(0/0):


Code:

#include<iostream> using namespace std; int main{ int a,b,n,m; m=a=b=0; for(n=0;n<1000;n++){ a++; if(a>20)a=1; b++; if(b>30) b=1; if(a==b)m++; } cout<<m<<endl; return 0; }


Run Info:

Main.cc:4:3: error: expected primary-expression before 'int'
   int a,b,n,m;
   ^
Main.cc:4:3: error: expected '}' before 'int'
Main.cc:4:3: error: expected ',' or ';' before 'int'
Main.cc:5:1: error: 'm' does not name a type
 m=a=b=0;
 ^
Main.cc:6:1: error: expected unqualified-id before 'for'
 for(n=0;n<1000;n++){
 ^
Main.cc:6:9: error: 'n' does not name a type
 for(n=0;n<1000;n++){
         ^
Main.cc:6:16: error: 'n' does not name a type
 for(n=0;n<1000;n++){
                ^
Main.cc:13:1: error: 'cout' does not name a type
 cout<