hdu 1108 最小公倍数
添加链接描述
#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y){
return y ? gcd(y, x % y) : x;
}
int lcm(int x, int y){
return x/gcd(x,y)*y;
}
int main(){
int x, y;
while(scanf("%d %d", &x, &y) == 2){
printf("%d\n", lcm(x, y));
}
return 0;
}