| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147746 | 林嘉乐 | 百钱买百鸡II | C++ | Compile Error | 0 MS | 0 KB | 363 | 2026-02-07 15:05:43 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,d=0; cin>>n; for(int a=0;a<=n/5;a++){ for(int b=0;b<=n/3;b++){ for(int c=0;c<=n/3;a++){ if(a+b+c*3==n&&5*a+3*b+c==n){ cnt++; cout<<cnt<<":"<<a<<","<<b<<","<<3*c<<endl; } } } } if(cnt==0)cout<<"None"<<endl; return 0; }
Main.cc: In function 'int main()':
Main.cc:10:9: error: 'cnt' was not declared in this scope
cnt++;
^
Main.cc:16:5: error: 'cnt' was not declared in this scope
if(cnt==0)cout<<"None"<