#include <stdio.h>
int main(){
int m,n,i;
int a,b,c,count;
while(scanf("%d %d",&m,&n)!=EOF){
count=0;
for(i=m;i<=n;i++){
c=i;
m=i;
a=m%10;
m/=10;
b=m%10;
m/=10;
if(c==a*a*a+b*b*b+m*m*m&&count==0){
printf("%d",c);
count++;
}//else presentation wrong
else if(c==a*a*a+b*b*b+m*m*m&&count>0) printf(" %d",c);
a=0;
b=0;
}
if(count==0) printf("no\n");
else printf("\n");
}
}
HDU 2010
最新推荐文章于 2018-10-27 09:23:03 发布