| ||||||||||
| 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<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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator