原题地址
没什么可说的
我的代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
int gcd(int x, int y)
{
if (!x || !y) return x > y? x:y;
for (int t; t = x %y; x =y ,y =t);
return y ;
}
using namespace std;
int main()
{
int a, b;
while (cin>>a>>b)
{
cout<<a*b / gcd(a,b)<<endl;
}
return 0;
}