Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main(){
- int num,r,sum,temp;
- for(num=1;num<=500;num++){
- temp=num;
- sum = 0;
- while(temp!=0){
- r=temp%10;
- temp=temp/10;
- sum=sum+(pow(r,3));
- }
- if(sum==num)
- printf("%d\n",num);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement