/*Enter 2 positive integers A, B, and output the least common multiple of A and B.*/
#include <stdio.h>
long long gcd(long long a,long long b){
return b==0?a:gcd(b,a%b);
}
int main(){
long long a,b;
//scanf("%d%d",&a,&b);
while (scanf("%lld%lld",&a,&b))
printf("%lld\n",a*b/gcd(a,b));
return 0;
}
/*
unsigned int (unsigned long)
4字节8位可表达位数:2^32=42 9496 7296
范围:0 ~ 42 9496 7295 (42*10^8)
int (long)
4字节8位可表达位数:2^32=42 9496 7296
范围:-21 4748 3648 ~ 21 4748 3647 (21*10^8)
long long (__int64)
8字节8位可表达位数:2^64=1844 6744 0737 0960 0000
范围:-922 3372 0368 5477 5808 ~ 922 3372 0368 5477 5807 (922*10^16)
unsigned long (unsigned __int64)
8字节8位可表达位数:2^64=1844 6744 0737 0960 0000
范围:0 ~ 1844 6744 0737 0955 1615 (1844*10^16)*/
最小公倍数LCM
最新推荐文章于 2024-06-29 15:22:52 发布