金山居----叛逆的小明

一到簡單題啊,可惜報的不是那場。。。

    #include<iostream>
    #include<cstring>
    #include<cstdio>
    using namespace std;
    int main()
    {
        int t,m,n;
        __int64 a,b,x,y,s,s1;
        while(cin>>t)
        {
            while(t--)
            {
                s=0,s1=0;
                cin>>x>>y;

                a=(x+y)/2;
                b=x-a;

                while(a)
                {
                    m=a%10;
                    a=a/10;
                    s=10*s+m;
                }
                while(b)
                {
                    n=b%10;
                    b=b/10;
                    s1=10*s1+n;
                }

                cout<<s+s1<<" "<<s-s1<<endl;
            }
        }
    }

 

發佈了29 篇原創文章 · 獲贊 13 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章