#include <stdio.h>
int lcm(int a,int b)
{
int s,g,l;
g = a>b?a:b;
l = a>b?b:a;
s = g;
while (1)
{
if (s%l==0)
return s;
s+=g;
}
}
int main()
{
int a,b;
while (scanf("%d%d",&a,&b)!=EOF)
printf("%d\n",lcm(a,b));
}
本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/03/31/2426982.html,如需转载请自行联系原作者