def gcd(a,b):return a if b==0 else gcd(b,a%b)因为 a==a%b+a//b*b因为gcd(a//b*b,b)==b而b%gcd(a%b,b)==0所以gcd(a,b)==gcd(b,a%b)最后当a%b==0,gcd(a,b)=b不知道这样理解对不..