Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109083 6张轶涵 水仙花数II C++ Accepted 1 MS 272 KB 373 2025-01-25 19:55:42

Tests(10/10):


Code:

#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; } //cout<<i<<" "<<h<<endl; if(h==i) { f=true; cout<<h<<" "; } h=0; } if(f==false) { cout<<"no"<<endl; } return 0; }