int GreatestCommonDivisor(int a, int b) {
int t;
if (a < b) {
// 交换两个数,使大数放在a的位置上。
t = a;
a = b;
b = t;
}
while (b != 0) {
// 利用辗转相除法,直到b为0为止。
t = a % b;
a = b;
b = t;
}
return a;
}
int LeastCommonMultiple(int a, int b) {
int t = a * b / GreatestCommonDivisor(a, b);
return t;
}
int main() {
cout << LeastCommonMultiple(318, 87632) << endl;
return 0;
}