int gcd(int a, int b)//求最大公约数,a为分子,b为分母 { if(b == 0) return a; return gcd(b,a%b); } 转载于:https://www.cnblogs.com/yosha/p/5240095.html