题解 | #求最小公倍数#
求最小公倍数
https://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
#include <iostream> using namespace std; int main() { int a, b; cin >> a >> b; int min = a>b ? a : b; int ret = 0; for(int i = 1;i <= min;i++) { if(a%i == 0 && b%i == 0) ret = i; } cout << a*b/ret << endl; return 0; }