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<iostream> using namespace std; int main() { long int x,y,m,n,L; int flag=0; int l; cout<<"please input the value of x,y,m,n,L"<<endl; cin>>x>>y>>m>>n>>L; if(x<=0||x>=2000000000) cout<<"the value of x is wrrong"<<endl; if(y<=0||y>=2000000000) cout<<"the value of y is wrrong"<<endl; if(m<=0||m>=2000000000) cout<<"the value of y is wrrong"<<endl; if(m<=0||n>=2000000000) cout<<"the value of y is wrrong"<<endl; if(L<=0||L>=2100000000) cout<<"the value of y is wrrong"<<endl; for(int time=0;;time++) if(!flag) { l=time*m+x-(time*n+y); if(l%L==0) {flag=1;cout<<"the time is "<<time<<endl; break;} } if(!flag) cout<<"inpossible"<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator