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:为什么WA?大家帮忙挑错啊!

Posted by 20062700 at 2007-08-09 08:38:46 on Problem 1061
In Reply To:为什么WA?大家帮忙挑错啊! Posted by:solu at 2007-08-06 21:59:29
> #include"stdio.h"
> int main()
> {  unsigned long  x,y,m,n,L,t;
>    scanf("%ld%ld%ld%ld%ld",&x,&y,&m,&n,&L);
>    if(x<y)
>    {  if(m==n) printf("Impossible\n");
>       else if(m>n)
> 	  {  t=(y-x)/(m-n);
>          if((float)t==(float)(y-x)/(float)(m-n))     printf("%ld\n",t);
> 	     else printf("Impossible\n");
> 	  }
>       else if(m<n)
> 	  {  t=(L+x-y)/(n-m);
>          if((float)t==(float)(L+x-y)/(float)(n-m))	  printf("%ld\n",t);
> 	     else printf("Impossible\n");
> 	  }
>    }
>    else if(x>y)
>    {  if(m==n) printf("Impossible\n");
>       else if(m<n)
> 	  {  t=(y-x)/(m-n);
>          if((float)t==(float)(y-x)/(float)(m-n))     printf("%ld\n",t);
> 	     else printf("Impossible\n");
> 	  }
>       else if(m>n)
> 	  {  t=(L-x+y)/(m-n);
>          if((float)t==(float)(L-x+y)/(float)(m-n))	  printf("%ld\n",t);
> 	     else printf("Impossible\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