| ||||||||||
| 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 <iostream>
#include <cmath>
int main()
{
unsigned long x,y,m,n,l;
std::cin>>x>>y>>m>>n>>l;
if((abs(x-y)%abs(m-n))||x==y) std::cerr<<"Impossible"<<std::endl;
else
{int i=0;
do
{x+=m;
if(x>=l) x-=l;
y+=n;
if(y>=l) y-=l;
i++;
}
while(x-y);
std::cout<<i<<std::endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator