Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7146 邓小龙 水仙花数II C++ Accepted 0 MS 260 KB 583 2025-04-05 14:08:34

Tests(10/10):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int m,n; int g,s,b; bool f=false;//假设没有 cin>>m>>n;//n到m的范围 for(int i=m;i<=n;i++){ g=i%10; s=i/10%10; b=i/100; if(i==g*g*g+s*s*s+b*b*b){ cout<<i<<" "; f=true; } } if(f==false) cout<<"no"<<endl; return 0; }