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 <iostream.h> #include <math.h> void main() { unsigned long int x,y,m,n,L,t; cin>>x>>y>>m>>n>>L; if(m==n) cout<<"Impossible"<<endl; else{ if(m>n) { if(abs(x-y)%(m-n)==0){ t=abs(x-y)/(m-n); cout<<t<<endl; } else cout<<"Impossible"<<endl; } else{ if((L-abs(x-y))%(n-m)==0){ t=(L-abs(x-y))/(n-m); cout<<t<<endl; } else cout<<"Impossible"<<endl; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator