Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
能不能帮我看一下,到底错在哪,高手们呀?拜托了!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator