File size: 465 Bytes
c4b0eef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
#include <cstdio>

using namespace std;

long int rev(long int num)
{
    long int reverseNum;
    reverseNum=0;
    while(num!=0)
    {
        reverseNum*=10;
        reverseNum+=num%10;
        num=num/10;
    }
    return reverseNum;

}
int main()
{
    long int num1,num2,num,t;
    cin>>t;
    while(t--)
    {
        scanf("%ld %ld",&num1,&num2);
        num=rev(num1)+rev(num2);
        printf("%ld\n",rev(num));
    }
    return 0;

}