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 IC0590501427 at 2005-12-01 13:23:40 on Problem 1061
#include<stdio.h>
void main(){
	int x,y,m,n,L;
	scanf("%d%d%d%d%d",&x,&y,&m,&n,&L);
	if(x!=y && x<2000000000 && y<2000000000 && m>0&&m<2000000000 &&n>0&&n<2000000000 &&L>0&&L<2100000000){
		if(m==n) printf("Impossible");
		if(m>n){
			if(x>y){
				if((y+L-x)%(m-n)==0) printf("%d",(y+L-x)/(m-n));
				else printf("Impossible");
			}
			if(x<y){
				if((y-x)%(m-n)==0) printf("%d",(y-x)/(m-n));
				else printf("Impossible");
			}
		}
        if(m<n){
			if(x>y){
				if((x-y)%(n-m)==0) printf("%d",(x-y)/(n-m));
				else printf("Impossible");
			}
			if(x<y){
				if((x+L-y)%(n-m)==0) printf("%d",(x+L-y)/(n-m));
				else printf("Impossible");
			}
		}
	}
}
		

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