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 sunshane at 2011-03-19 16:02:51 on Problem 1061
#include<stdio.h>
int main()
{
	unsigned int x,y,m,n,L,d;
	scanf("%d %d %d %d %d",&x,&y,&m,&n,&L);
    if(x<y)
	{
	   if(m<n)
	   {
	     d=(L-y+x)/(n-m);
		 printf("%d\n",d);
	   }
	   else if(m==n)
		   printf("Impossible\n");
	   else if(m>n)
	   {
	     d=(y-x)/(m-n);
		 printf("%d\n",d);
	   }
	}	
	else
	{
	   if(m<n)
	   {
	     d=(x-y)/(n-m);
		 printf("%d\n",d);
	   }
	   else if(m=n)
		   printf("Impossible\n");
	   else if(m>n)
	   {
	     d=(L-x+y)/(m-n);
		 printf("%d\n",d);
	   }
	} 
	
	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