#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <stack>
#include <string>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <map>
#include <functional>
#include <set>
#include <limits.h>
#include <math.h>
#include <ctype.h>
using namespace std;
//1089
int n,a,b;
int tran(int x)
{
int y=0;
do{
y=y*10+x%10;
x/=10;
}while(x);
return y;
}
int main()
{
while(cin>>n)
{
while(n--)
{
cin>>a>>b;
int c=a+b;
if( tran(c) == tran(a)+tran(b) )
cout<<c<<endl;
else
cout<<"NO"<<endl;
}
}
return 0;
}
/**************************************************************
Problem: 1089
User: cust123
Language: C++
Result: Accepted
Time:0 ms
Memory:1520 kb
****************************************************************/
题目1089:数字反转
最新推荐文章于 2024-03-07 14:55:54 发布