Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- int n;
- scanf("%d",&n);
- while(n--)
- { int a,b,c,sum,sum1;
- char str[1000];
- scanf("%s",str);
- a=str[2]-48;
- b=str[1]-48;
- c=str[0]-48;
- sum=a*a*a+b*b*b+c*c*c;
- printf("%d",sum);
- sum1=a+b*10+c*100;
- printf("\n%d\n",sum1);
- if(sum=sum1);
- printf("%d is armstrong",sum);
- else
- printf("%d is not armstrong",sum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement