Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
96609 | 程余天皓 | 水仙花数II | C++ | Compile Error | 0 MS | 0 KB | 272 | 2024-11-09 11:28:09 |
#include<bits/stdc++.h> using namespace std; int main() { int n,m,sum=0; cin>>n; int g=n%10; int s=n/10%10; int b=n/100%10; if(g*g*g+s*s*s+b*b*b==i){ cout<<i<<" "; sum++; } } if(sum==0){ cout<<"NO"; } return 0; }
Main.cc: In function 'int main()': Main.cc:10:27: error: 'i' was not declared in this scope if(g*g*g+s*s*s+b*b*b==i){ ^ Main.cc:5:11: warning: unused variable 'm' [-Wunused-variable] int n,m,sum=0; ^ Main.cc: At global scope: Main.cc:15:1: error: expected unqualified-id before 'if' if(sum==0){ ^ Main.cc:18:5: error: expected unqualified-id before 'return' return 0; ^ Main.cc:19:1: error: expected declaration before '}' token } ^