-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathADDREV.cpp
More file actions
57 lines (52 loc) · 974 Bytes
/
ADDREV.cpp
File metadata and controls
57 lines (52 loc) · 974 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<bits/stdc++.h>
using namespace std;
//Shubhank Khare
#define MOD 1000000007
#define VALUEIN
#ifdef VALUEIN
#define valuein(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define valuein(...)
#endif
static auto _ = []()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
return nullptr;
}();
int main() {
long long int t;
scanf("%lld",&t);
while(t--)
{
int n1,n2,rev1=0,rev2=0,rev3=0;
scanf("%d%d",&n1,&n2);
while(n1)
{
rev1=rev1*10+n1%10;
n1=n1/10;
}
while(n2)
{
rev2=rev2*10+n2%10;
n2=n2/10;
}
rev3=rev1+rev2;
rev1=0;
while(rev3)
{
rev1=rev1*10+rev3%10;
rev3/=10;
}
printf("%d\n",rev1);
}
return 0;
}