文章
145
粉丝
217
获赞
21
访问
84.9k
#include <stdio.h>
int DaffodilNum(int n)
{
int a,b,c;
a = n%10;
b = n/10%10;
c = n/100;
if(a*a*a+b*b*b+c*c*c == n)
return 1;
else return 0;
}
int main()
{
int m,n,i,flag;
while (scanf("%d %d",&m,&n) != EOF)
{
flag = 0;
if(m == 0 && n == 0) break;
for(i = m; i <= n; i++)
if(DaffodilNum(i))
{
flag = 1;
printf("%d ",i);
}
if(!flag) printf("no");
printf("\n");
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发