private static int minCommonMultiple(int m,int n){ return n * m / maxCommonDivisor(m,n); } /** * 求最大公约数 **/ private static int maxCommonDivisor(int m,int n){ if(m < n){// 确保m > n int t = m; m = n; n = t; } int t = 0; while ((t = m % n) != 0){ m = n; n = t; } return n; }