Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- unsigned long reverseInteger(unsigned long n) {
- unsigned long result = 0, t;
- while(n) {
- t = n % 10;
- result = result * 10 + t;
- n /= 10;
- }
- return result;
- }
- int main(void) {
- unsigned int t;
- unsigned long a, b;
- scanf("%d", &t);
- while(t--) {
- scanf("%lu %lu", &a, &b);
- printf("%lu\n", reverseInteger(reverseInteger(a) + reverseInteger(b)));
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment