Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
15959 周燚 水仙花数 C++ Accepted 3 MS 728 KB 318 2021-07-20 17:01:00

Tests(10/10):


Code:

#include<iostream> using namespace std; int main() { int ge,shi,bai,n,m; int cnt=0; cin>>n>>m; for(int i=n;i<=m;++i){ bai=i/100; shi=(i/10)%10; ge=i%10; if(bai*bai*bai+shi*shi*shi+ge*ge*ge==i){ cout<<i<<" "; ++cnt; } } if(cnt==0) cout<<"no"<<endl; return 0; }