Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109082 | 6张轶涵 | 水仙花数II | C++ | Wrong Answer | 1 MS | 272 KB | 344 | 2025-01-25 19:51:43 |
#include <bits/stdc++.h> using namespace std; bool f=false; int main() { int n,m; int h=0; int k; cin>>n>>m; for(int i=n;i<=m;i++) { k=i; while(k>=1) { h+=(k%10)*(k%10)*(k%10); k/=10; } if(h==k) { f=true; cout<<k<<" "; } h=0; } if(f==false) { cout<<"no"<<endl; } return 0; }
------Input------
400 600
------Answer-----
407
------Your output-----
no