#include<stdio.h>
#include<string.h>
void swap(int &x,int &y)
{
int temp;
if(x<y)
{
temp=x;
x=y;
y=temp;
}
}
int fun(int x,int y)
{
int a,b,r;
a=x,b=y;
swap(x,y);
while(r)
{
r=x%y;
x=y;
y=r;
}
return a*b/x;
}
int main( )
{
int N,M;
while(scanf("%d%d",&N,&M)!=EOF)
printf("%d\n",fun(N,M));
return 0;
}
转载于:https://www.cnblogs.com/tangcong/archive/2011/05/02/2034339.html