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 stope234 at 2005-10-01 15:53:50 on Problem 1061
#include "stdafx.h"


void main()
{
long x,y,m,n,l;
cin>>x>>y>>m>>n>>l;
int a,e,f,d=1;
if(m>n)
{
	if(x<y)
		a=y-x;
	else a=l+x-y;
}
else
{
	if(x<y)
		a=l+x-y;
	else a=y-x;
}
int c,b=1;
while(b<=x)
{
	if(x/b==int(x/b))
	{
		if(y/b==int(y/b))
			c=b;
	}
	else
	{
	}
   	b++;
}
if(a/c==int(a/c))
{
	while((e-f)/l!=int((e-f)/l))
{
	e=m*d;f=y-x+n*d;
		d++;
	}
	cout<<"需跳"<<d<<"步";
}
else
{
	cout<<"impossible";
}
}

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