import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.FileReader;
import java.util.Scanner;
class Main
{
public static final boolean DEBUG = false;
public static int gcd(int a, int b)
{
return b == 0 ? a : gcd(b, a % b);
}
public static void main(String[] args) throws IOException
{
Scanner cin;
int a, b;
if (DEBUG) {
cin = new Scanner(new FileReader("d:\\OJ\\uva_in.txt"));
} else {
cin = new Scanner(new InputStreamReader(System.in));
}
while (cin.hasNext()) {
a = cin.nextInt();
b = cin.nextInt();
System.out.println(a * b / gcd(a, b));
}
}
}
题目1438:最小公倍数
最新推荐文章于 2021-05-16 01:52:36 发布