Skip to content

Instantly share code, notes, and snippets.

@completejavascript
Created September 15, 2018 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save completejavascript/75288d491f81e95771e6d0bdbd7b4900 to your computer and use it in GitHub Desktop.
Save completejavascript/75288d491f81e95771e6d0bdbd7b4900 to your computer and use it in GitHub Desktop.
#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