Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119117 | 曹春贵 | 水仙花数II | C++ | Accepted | 1 MS | 272 KB | 326 | 2025-05-16 20:07:24 |
#include<bits/stdc++.h> using namespace std; int main() { int m,n; bool flag = false; cin>>m>>n; for(int i=m;i<=n;i++) { int a,b,c; a=i%10; b=i/10%10; c=i/100; if((c*c*c+b*b*b+a*a*a)==i) { flag = true; cout<<i<<" "; } } if(!flag) { cout<<"no"<<endl; } return 0; }