#include <iostream>
using namespace std;
int main()
{int lcm(int x,int y);
int a,b,c;
cout<<"please enter two numbers:";
cin>>a>>b;
c=lcm(a,b);
cout <<c<< endl;
return 0;
}
int lcm(int x,int y)
{int i=1,t,u;
while(t!=0)
{u=x*i;
t=u%y;
i++;
}
return(u);
}
网友评论