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.h> int main() { int x,y,m,n,l; cout<<"请输入A、B的坐标:"; cin>>x>>y; cout<<"请输入A、B每次跳的步数:"; cin>>m>>n; cout<<"轨道长度:"; cin>>l; for(int i=1;i<100000;i++) { if((m*i+x)%l==(n*i+l)%l) { return i; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator