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 hpxyz70345 at 2007-07-18 15:59:07 on Problem 1061
#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:
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