简单易懂
#include<bits/stdc++.h>
using namespace std;
int lcm(int a, int b)
{
if (a > b)
{
int t = a;
a = b;
b = t;
}
for (int i = a; i <= a * b; i++)
if (i % a == 0 && i % b == 0)
return i;
}
int main()
{
int a, b;
cin >> a >> b;
cout << lcm(a, b) << endl;
return 0;
}