閱讀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實現下載功能