首页
mac
it
登录
6mi
u
盘
搜
搜 索
it
python计算最大公约数和最小公倍数
python计算最大公约数和最小公倍数
mac
2022-06-30
19
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))#最小公倍数
转载于:https://www.cnblogs.com/c-x-a/p/10023449.html
转载请注明原文地址: https://mac.8miu.com/read-67659.html
最新回复
(
0
)