Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96814 | 王思颜 | 百钱买百鸡II | C++ | Compile Error | 0 MS | 0 KB | 390 | 2024-11-09 16:08:21 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,s = 0; cin>>n; for (int x = 1;x <= n / 5;x++){ for (int y = 1;y <= n / 3;y++){ for (int z = 1;z <= n / 1;z++){ if (x + y + z == n;5 * x + 3 * y == n){ cout<<"第"<<x<<"种方案"<<":"<<x<<","<<y<<","<<z<<endl; s = 1; } } } } if (s == 0){ cout<<"None" } return 0; }
Main.cc: In function 'int main()': Main.cc:10:23: error: expected ')' before ';' token if (x + y + z == n;5 * x + 3 * y == n){ ^ Main.cc:10:42: error: expected ';' before ')' token if (x + y + z == n;5 * x + 3 * y == n){ ^ Main.cc:10:38: warning: statement has no effect [-Wunused-value] if (x + y + z == n;5 * x + 3 * y == n){ ^ Main.cc:19:2: error: expected ';' before '}' token } ^