【思路】:可移步至多个数的最小公倍数1019。
【AC代码】:
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iomanip>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
int a = 0, b = 0;
while (cin >> a >> b)
{
int m = a, n = b;
while (m!=n)
{
if (m>n)
m = m-n;
else
n = n-m;
}
cout << a/m*b << endl;
}
return 0;
}