Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
106871 | 胡海峰老师 | 水仙花数II | C++ | Accepted | 1 MS | 280 KB | 355 | 2025-01-16 22:18:58 |
#include <iostream> using namespace std; int main () { int m,n,f; int a,b,c; //百,十,个 f = 0; cin>>m>>n; for(int x=m;x<=n;x++) { a = x/100; c = x%10; b = x/10%10; //365-- 36 -- 6 if(a*a*a + b*b*b+c*c*c == x) { cout<<x<<" "; f =1; } } if(f==0) cout<<"no"; return 0; }