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; }