a,b的最小公倍数 = a × b ÷ (a,b的最大公约数)
n个数的最小公倍数 = n个数乘积 ÷ (n-1组的最大公约数乘积)
#include <iostream>
using namespace std;
int greatest_common_divisor(int a, int b) {
if (a<b) {
int temp = a;
a = b;
b = temp;
}
int res = -1;
while (res != 0) {
res = a%b;
a = b;
b = res;
}
return a;
}
int main(int argc, const char * argv[]) {
int a, b, c;
cin >> a >> b >> c;
int gcd = greatest_common_divisor(a, b);
gcd *= greatest_common_divisor(b, c);
cout << a*b*c/gcd << endl;
return 0;
}