#include<cstdio>
int GCD(int a,int b)
{
if(a%b==0)
return b;
else
return GCD(b,a%b);
}
int LCM(int a,int b)
{
return a/GCD(a,b)*b; //防爆
}
int main()
{
int a,b,c;
while(~scanf("%d%d",&a,&b))
{
printf("%d\n",LCM(a,b));
}
return 0;
}
GCD+LCM 模板
最新推荐文章于 2021-05-16 22:21:33 发布