今天偶然发现一个很简洁的写法 赶紧记录下来 ^A^ ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); } ll lcm(ll a,ll b) { return a*b/gcd(a,b); }