OJ-Problems-Source/HDOJ/3352_autoAC.cpp
2016-09-01 20:54:35 +08:00

22 lines
334 B
C++

#include<stdio.h>
long long a,b;
long long up(long long a,long long b)
{
long long t;
if(a==0) return b;
while(b!=0)
{
t=b;b=a%b;a=t;
}
return a;
}
int main()
{
while(scanf("%lld%lld",&a,&b)!=EOF)
{
if(a==0&&b==0) break;
printf("%lld\n",a*b/up(a,b)/up(a,b));
}
return 0;
}