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

郁闷!!

Posted by mingjiereng at 2010-05-28 20:03:15 on Problem 2301
  为什么#include"stdio.h"
main()
{
	int n,s,d,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d",&s,&d);			
		 if((s-d>=0)&&((s-d)%2==0)&&((s+d)%2==0))				
		 printf("%d %d\n",(s+d)/2,(s-d)/2);
		else
				printf("impossible\n");

	}


}能过,可是下面的却不能过!!明明s+d>0多余的条件,对结果没有影响,却过不了!!!
#include"stdio.h"
main()
{
	int n,s,d,i;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d",&s,&d);			
		 if((s-d>=0)&&((s-d)%2==0)&&((s+d)%2==0)&&((a+b)>0))				
		 printf("%d %d\n",(s+d)/2,(s-d)/2);
		else
				printf("impossible\n");

	}


}

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