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 |
为什么WA?大家帮忙挑错啊!#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)(n-m)) 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator