首页后端开发Pythonpython最小约数

python最小约数

时间2023-06-04 11:38:02发布访客分类Python浏览1028
导读:python最小约数?利用辗转相除法求出a=int(input('please enter 1st num:' b=int(input('please enter 2nd num:' s=a*bwhile a%b!=0:a,b=b,(a...

python最小约数?

利用辗转相除法求出

a=int(input('please enter 1st num:'))

b=int(input('please enter 2nd num:'))

s=a*b

while a%b!=0:

a,b=b,(a%b)

else:

print(b,'is the maximum common divisor')

print(s//b,'is the least common multiple')

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: python最小约数
本文地址: https://pptw.com/jishu/61033.html
python列表可以append一个数组吗 python编程装win10还是win7

游客 回复需填写必要信息