AI工具人
提示词工程师

hdoj 4554 叛逆的小明


//hdoj 4554
//2013-05-26-19.47
#include <stdio.h>

int turn(int x)
{
    int f = 1;
    if (x < 0)
    {
        x = -x;
        f = -1;
    }
    int s = 0;
    while (x)
    {
        s *= 10;
        s += x%10;
        x /= 10;
    }
    return s*f;
}

int main()
{
    int x, y;
    int t;
    scanf("%d", &t);
    while (t--)
    {
        scanf("%d %d", &x, &y);
        int a = (x+y)>>1;
        int b = x-a;
        a = turn(a);
        b = turn(b);
        printf("%d %d\n", a+b, a-b);
    }
    return 0;
}

赞(0) 打赏
未经允许不得转载:XINDOO » hdoj 4554 叛逆的小明

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册