Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109081 | 6张轶涵 | 水仙花数II | C++ | Time Limit Exceeded | 1000 MS | 264 KB | 344 | 2025-01-25 19:49:50 |
#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>=0) { 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; }