最小公倍数=两个数的乘积/两个数的最大公约数。
接上篇求最大公约数方法,最小公倍数的代码如下:
public class LCM {
	//最小公倍数=两数乘积/最大公约数
	public static int lcm(int m, int n){
		return m*n/GCD.gcd(m,n);
	}
	public static void main(String[] args){
		System.out.println(lcm(0,9));
	}
}0
最小公倍数(Least Common Multiple),布布扣,bubuko.com
原文:http://blog.csdn.net/foreverbu/article/details/37815473