最大公约数求解 int gcd(int a,int b) { return b==0?a:gcd(b,a%b); } 最小公倍数 int lcm(int a,int b) { return a/gcd(a,b)*b; }