a=4 b=2 def gcd(a,b): # 欧几里得 return a if b==0 else gcd(b,a%b) def lcm(a,b): return a*b//gcd(a,b) print(gcd(a,b))#最大公约数 print(lcm(a,b))#最小公倍数
最大公约,最小公倍(Python)
猜你喜欢
转载自www.cnblogs.com/cassielcode/p/12468990.html
今日推荐
周排行