题解 | #求最小公倍数#
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
#include <algorithm>
using namespace std;
int main() {
int x1,x2;
while(cin>>x1>>x2){
int out;
int mi,mx;
mi=min(x1,x2);
mx=max(x1,x2);
out = mx;
while(out!=0){
out = abs(mx-mi);
mi = min(mx,mi);
mx = out;
}
cout<<(x1*x2)/mi<<endl;
}
}