def gcd(a,b):
? ? if a<b:
? ? ? ? smaller=a
? ? else:
? ? ? ? smaller=b
? ? for i in range(smaller,0,-1):
? ? ? ? if a%i==0 and b%i==0:
? ? ? ? ? ? return smaller
? ? ? ? else:
? ? ? ? ? ? smaller-=1
def lcm1(a,b):
? ? g=gcd(a,b)
? ? return a*b/g文章來源:http://www.zghlxwxcb.cn/news/detail-406813.html
跑不出結(jié)果,求指教哪里出問題文章來源地址http://www.zghlxwxcb.cn/news/detail-406813.html
到了這里,關(guān)于HJ108:求最小公倍數(shù) python的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!