1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c,n; 5 while(~scanf("%d",&n)&&n) 6 { 7 a=n/100; 8 b=n/10%10; 9 c=n%10; 10 if(a*a*a+b*b*b+c*c*c==n) 11 printf("Yes "); 12 else 13 printf("No "); 14 } 15 return 0; 16 }
1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c,n; 5 while(~scanf("%d",&n)&&n) 6 { 7 a=n/100; 8 b=n/10%10; 9 c=n%10; 10 if(a*a*a+b*b*b+c*c*c==n) 11 printf("Yes "); 12 else 13 printf("No "); 14 } 15 return 0; 16 }