文章目录 辗转相除法求最大公约数 辗转相除法求最大公约数 int getMaxCommonDivisor(int n, int m) { int a = n % m; while(a != 0) { n = m; m = a; a = n % m; } return m; }