#include <iostream>
#include <stdio.h>
using namespace std;
int fun(int x,int y)
{
return y?fun(y,x%y):x;
}
int main()
{
int a,b;
while (scanf("%d%d",&a,&b)!=EOF)
{
cout<<a/fun(a,b)*b<<endl;
}
}
hdu/hdoj 1108 最小公倍数

#include <iostream>
#include <stdio.h>
using namespace std;
int fun(int x,int y)
{
return y?fun(y,x%y):x;
}
int main()
{
int a,b;
while (scanf("%d%d",&a,&b)!=EOF)
{
cout<<a/fun(a,b)*b<<endl;
}
}