Guest User

Untitled

a guest
Feb 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. unsigned long reverseInteger(unsigned long n) {
  4. unsigned long result = 0, t;
  5.  
  6. while(n) {
  7. t = n % 10;
  8. result = result * 10 + t;
  9. n /= 10;
  10. }
  11.  
  12. return result;
  13. }
  14.  
  15. int main(void) {
  16. unsigned int t;
  17. unsigned long a, b;
  18.  
  19. scanf("%d", &t);
  20.  
  21. while(t--) {
  22. scanf("%lu %lu", &a, &b);
  23. printf("%lu\n", reverseInteger(reverseInteger(a) + reverseInteger(b)));
  24. }
  25.  
  26. return 0;
  27. }
Add Comment
Please, Sign In to add comment