ZOJ 2388 Beat the Spread!

来源:互联网 发布:软件随想录 txt 编辑:程序博客网 时间:2024/06/05 00:19
//2615589 2011-08-04 21:39:04 Accepted 2388 C 0 160 ylwh!//2615587 2011-08-04 21:36:35 Wrong Answer 2388 C 0 160 ylwh!//2615574 2011-08-04 21:29:22 Wrong Answer 2388 C 0 160 ylwh!#include <stdio.h>int main(){int n, s, d, x, y;scanf("%d", &n);while(n--){scanf("%d%d", &s, &d);x = s + d;y = s - d;if(x % 2 ||  y % 2 || y < 0)//条件竟然写错了.....Orz.....printf("impossible");elseprintf("%d %d", x / 2, y / 2);if(n) printf("\n");}    return 0;}


原创粉丝点击