Input 2个数A,B,中间用空格隔开。(1<= A,B <= 10^9) Output 输出A与B的最小公倍数。 Sample Input
30 105Sample Output
210
#include<stdio.h>
int main()
{
int gcd(long long int a,long long int b);
long long int A,B;
scanf("%lld%lld",&A,&B);
printf("%lld
",A*B/gcd(A,B));
return 0;
}
int gcd(long long int a,long long int b)
{
return b==0?a:gcd(b,a%b);
}
...