Created
September 15, 2018 03:49
-
-
Save completejavascript/75288d491f81e95771e6d0bdbd7b4900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int getRevere(int a) | |
{ | |
int leng = 0; | |
int p[10]; | |
while(a) | |
{ | |
int t = a % 10; | |
p[leng++] = t; | |
a = a/10; | |
} | |
int x = 0; | |
for(int i = 0; i < leng; i++) | |
x = x * 10 + p[i]; | |
return x; | |
} | |
int main() | |
{ | |
ios::sync_with_stdio(false); | |
// comment trước khi submit | |
freopen("input.txt","r",stdin); | |
int T = 0; | |
cin >> T; | |
for(int i = 0; i < T; i++) | |
{ | |
int x, y; | |
cin >> x >> y; | |
int a = getRevere(x) + getRevere(y); | |
cout << getRevere(a) << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment