1 int gcd(int a, int b) 2 { 3 if (b == 0) 4 return a; 5 return gcd(b, a % b); 6 }
辗转相除法。
求最大公约数
原文:https://www.cnblogs.com/lxc1910/p/8511934.html