Advertisement
Falak_Ahmed_Shakib

some time

Jul 19th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. int n;
  6. scanf("%d",&n);
  7. while(n--)
  8. { int a,b,c,sum,sum1;
  9. char str[1000];
  10. scanf("%s",str);
  11. a=str[2]-48;
  12. b=str[1]-48;
  13. c=str[0]-48;
  14. sum=a*a*a+b*b*b+c*c*c;
  15. printf("%d",sum);
  16. sum1=a+b*10+c*100;
  17. printf("\n%d\n",sum1);
  18. if(sum=sum1);
  19. printf("%d is armstrong",sum);
  20. else
  21. printf("%d is not armstrong",sum);
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement