一次性AC,用时8分钟
#include<iostream>
using namespace std;
int lcm(int n1,int n2)
{
int s;
if(n1>n2)
s=n1;
else
s=n2;
while(s%n1!=0 || s%n2!=0)
s++;
return s;
}
int main()
{
// freopen("xxx.in","r",stdin);
// freopen("yyy.out","w",stdout);
int n1,n2;
cin >> n1 >> n2;
cout << lcm(n1,n2);
// fclose(stdin);
// fclose(stdout);
return 0;
}