题解 | #求最小公倍数#
求最小公倍数
http://www.nowcoder.com/practice/22948c2cad484e0291350abad86136c3
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String ab = scan.nextLine();
int a = Integer.valueOf(ab.split(" ")[0].trim());
int b = Integer.valueOf(ab.split(" ")[1].trim());
int gcdVal = gcd(a, b);
System.out.println(a * b / gcdVal);
}
public static int gcd(int m, int n) {
return n == 0 ? m : gcd(n, m % n);
}
}