Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
15441 | 高宏伟 | 水仙花数 | C++ | Accepted | 3 MS | 724 KB | 408 | 2021-07-15 16:15:58 |
#include<iostream> using namespace std; int main(){ int a,b,c=0; cin>>a>>b; for(int i=a;i<=b;i++){ int t=i%10; t=t*t*t; int tt=i/10%10; t+=tt*tt*tt; tt=i/100; t+=tt*tt*tt; if(t==i){ if(c==0) cout<<i; else cout<<" "<<i; c++; } } if(c==0) cout<<"no"; cout<<endl; return 0; }