文章
160
粉丝
0
获赞
626
访问
24.4k
#include<iostream>
using namespace std;
int m,n;
bool check(int n)
{
int copy=n;
int sum=0;
while(copy)
{
int x=copy%10;
sum+=x*x*x;
copy/=10;
}
if(sum==n)
return true;
return false;
}
int main()
{
while(cin>>m>>n)
{
int cnt=0;
if(m==0&&n==0)
break;
for(int i=m;i<=n;i++)
{
if(check(i))
{
cout<<i<<" ";
cnt++;
}
}
if(cnt==0)
cout<<"no";
puts("");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发