题解 | #求最小公倍数#简单快捷
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
#include <bits/stdc++.h> using namespace::std;
int main() {
int n = 0;
int m = 0;
while (cin >> n >> m) {
int tmp = 0;
int mul = n * m;
if (n < m) {
swap(n, m);
}
while (tmp = n % m) {
n = m;
m = tmp;
}
cout << mul / m << endl;
}
return 0;
}