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 dalianhema328 at 2008-04-23 16:46:01
#include<stdio.h>
void main()
{
	int i=0,a,b,x,y,m,n,l;
	scanf("%d%d%d%d%d",&x,&y,&m,&n,&l);
	do
	{
		i++;
		a=x+i*m;
		b=y+i*n;
	}while(((a-b)%l!=0)||(i>1000));
	if((a-b)%l==0)
		printf("%d",i);
	else
	    printf("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