HJ108:求最小公倍数 python

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

跑不出结果,求指教哪里出问题


版权声明:本文为m0_66389477原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。