python最小约数
导读: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