andre_joy

导航

hdu 1194

地址:http://acm.hdu.edu.cn/showproblem.php?pid=1194

题意:赌球,用比分的和与比分的差的绝对值赌博。

mark:注意比分都是整数。

代码:

#include <stdio.h>

int main()
{
    int t,m,n;
    scanf("%d", &t);
    while(t-- && scanf("%d%d", &m, &n))
        if(m < n || (m+n) & 1) puts("impossible");
        else printf("%d %d\n", (m+n)/2, (m-n)/2);
    return 0;
}

posted on 2012-07-03 23:21  andre_joy  阅读(101)  评论(0编辑  收藏  举报