Description
邱胖胖的体重为A,斌哥的体重为B,(A,B为正整数),问他们两个人体重的最小公倍数?
Input
输入两个正整数A,B(0<A,B<10^4)
Output
输出一个正整数C,C为A和B的最小公倍数。
Sample Input
3 9
Sample Output
9
#include<stdio.h>
int main()
{
long long A, B, C;
scanf("%lld%lld", &A, &B);
long long a = A, b = B;
while (B>0)
{
long long temp = A % B;
A = B;
B = temp;
}
long long gcd = A;
C = a * b / gcd;
printf("%lld\n", C);
return 0;
}