#include<iostream>
using namespace std;
int gcd(int a,int b)
{
if(a<b)
{int t;
t=a;
a=b;b=t;}
if(a%b==0)
{return b;}
else
{return gcd(b,a%b);}
}
int main()
{
int a,b,s;
cin>>a>>b;
s=a*b/gcd(a,b);
cout<<s<<endl;
system("pause");
return 0;
}
【华为oj】求最小公倍数
最新推荐文章于 2021-03-23 10:54:09 发布