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 200309010208 at 2005-09-06 11:33:29 on Problem 1061
#include <iostream.h>
#include <math.h>
int main()
{
	long x,y,m,n,L;
	cin>>x>>y>>m>>n>>L;
	
	int i=0;
	
    while (1)
    {
		if (m==n)
		{
			cout<<"Impossible";
			break;
		}
		i++;
		x=(x+m)%L;
		y=(y+n)%L;
		if (x==y)
		{
			cout<<i;
			break;
		}
		else if (i>L/abs(m-n))
		{
			cout<<"Impossible";
			break;
		}
		
    }
	
	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