#include<iostream>
#include<math.h>
using namespace std;

 

//倒转函数
int chang(int a)
{
    int comp;
    int len=0;
    comp=a;
    while(comp!=0)
    {
        len++;
        comp/=10;
    }
    int out=0;
    int i;
    int bit;
    while(a!=0)
    {
        i=a%10;
        bit=pow(10,--len);
        if(i!=0)
            out+=i*bit;
        a/=10;
    }

    return out;
}

 

int main()
{
    int num;
    int a,b;
    int c;
    cin>>num;
    while(num--)
    {
        cin>>a>>b;
        a=chang(a);
        b=chang(b);
        c=a+b;
        cout<<chang(c)<<endl;
    }
     return 0;
}

 

posted on 2010-05-12 11:08  VRS  阅读(175)  评论(0)    收藏  举报