/*
试编一程序,求出他俩下次相遇最小的天数。
*/
#include<iostream>
using namespace std;
int main()
{
int x,y,temp,s,i=1;
cout<<"请输入两个自然数:";
cin>>x>>y;
if(x>y)
{
temp=x;
x=y;
y=temp;
}
s=y*i;
while( s%x != 0 )
{
i++;
s=y*i;
}
cout<<"最小公倍数:"<<s<<endl;
return 0;
}
//思考题:用for循环怎么做
//x*y/最大公约数=最小公倍数
//辗转相除法求最大公约数