Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:对这样的题目我很无语!

Posted by mll_world at 2012-10-22 21:30:02 on Problem 2301
In Reply To:对这样的题目我很无语! Posted by:chenxuan123456789 at 2012-08-11 12:54:32
> #include <stdio.h>
> int main()
> {
> 	int cases,a,b;
> 	scanf("%d",&cases);
> 	while(cases--)
> 	{
> 		scanf("%d %d",&a,&b);
> 		if(b>a||(a%2==0&&b%2==1)||(a%2==1&&b%2==0))
> 		printf("impossible\n");
> 		else
> 		printf("%d %d\n",(a+b)/2,(a-b)/2);
> 	}
> 	return 1;
> }
能接受么 ?a,b都要大于等于0,

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator