计算最大公倍数
Static int gcd( int a, int b) { int t; while( b>0) { t = b; b = a % b; a = t; } return a; } private static int getGCD(int a, int b) { if (a == 0) return b; while (a != b) { if (a > b) a = a - b; else if (b > a) b = b - a; else return a; } }
计算最大公倍数
Static int gcd( int a, int b) { int t; while( b>0) { t = b; b = a % b; a = t; } return a; } private static int getGCD(int a, int b) { if (a == 0) return b; while (a != b) { if (a > b) a = a - b; else if (b > a) b = b - a; else return a; } }