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 sunwen at 2007-09-23 15:53:47 on Problem 3386
In Reply To:我的怎么错了 有什么特殊的地方? Posted by:sunwen at 2007-09-23 15:53:25
#include<stdio.h>
int main()
{
	int A,B,a,b,P,flag1,flag2;
	while(scanf("%d%d%d%d%d",&A,&a,&B,&b,&P)!=EOF)
	{
		if(a<=0||P<=0||A<=0||B<=0||b<=0)
		{	
			printf("No\n");
			return 0;
		}
		if(a>=A||b>=B)
		{
			printf("No\n");
			return 0;
		}
		if(A>P||B>P)
		{
		printf("No\n");
		return 0;
		}
		if(A>B)
		{
			flag1=2*(P-A);
			flag2=2*(A-a);
			if(flag1>=2*B||flag2>=2*B)
				printf("Yes\n");
			else
				printf("No\n");
		}
		else
		{
			flag1=2*(P-B);
			flag2=2*(B-b);
			if(flag1>=2*A||flag2>=2*A)
				printf("Yes\n");
			else
				printf("No\n");
		}
	}
	return 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