Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
97521 何思佳 百钱买百鸡II C++ Compile Error 0 MS 0 KB 300 2024-11-16 10:18:23

Tests(0/0):


Code:

int n,a=0; cin>>n; for(int x=0;x<=n;x++){ for(int y=0;y<=n;y++){ for(int z=0;z<=n;z++){ if(x+y+z==n&&5*x+3*y+z/3==n&&z%3==0){ a++; printf("%d: %d,%d,%d",a,x,y,z); cout<<endl; } } } } if(a==0){ cout<<"None"; }


Run Info:

Main.cc:2:1: error: 'cin' does not name a type
 cin>>n; 
 ^
Main.cc:3:1: error: expected unqualified-id before 'for'
 for(int x=0;x<=n;x++){ 
 ^
Main.cc:3:13: error: 'x' does not name a type
 for(int x=0;x<=n;x++){ 
             ^
Main.cc:3:18: error: 'x' does not name a type
 for(int x=0;x<=n;x++){ 
                  ^
Main.cc:14:1: error: expected unqualified-id before 'if'
 if(a==0){ 
 ^