阅读725 返回首页    go 阿里云 go 技术社区[云栖]


poj 2301 Beat the Spread!

刷呀刷。。。


AC的代码:

#include <stdio.h>

int main()
{
	int n;
	int s,d;
	int a;   //Team a's score

	scanf("%d",&n);

	while(n--)
	{
		scanf("%d%d",&s,&d);
		if((s+d)%2!=0)
		{
			printf("impossible\n");
			continue;
		}

		a=(s+d)/2;

		if(s-a<0)
		{
			printf("impossible\n");
			continue;
		}

		printf("%d %d\n",a,s-a);
	}
	
	return 0;
}


最后更新:2017-04-03 05:39:56

  上一篇:go 智能家居项目(3):编译工具makefile
  下一篇:go 采用linux下java http实现下载功能