2010 c
[code]
#include <stdio.h>
int main(){
int m,n,i;
int a,b,c; //依次为个位,百位和十位
int flag=0;
while(scanf("%d %d",&m,&n)!=EOF){
for(i=m;i<=n;i++){
a=i%10;
b=i/100;
c=(i-b*100)/10;
if(a*a*a+b*b*b+c*c*c==i){
if(flag==1) printf(" ");
printf("%d",i);
flag=1;
}//if
}//for
if(flag==0) printf("non");
else printf("n");
flag=0;
}//while
return 0;
}
[/code]
杭电ACM_2010
最新推荐文章于 2024-09-28 17:54:45 发布