Python Tricks(十三)—— 欧几里得算法

def gcd(m, n):
    if n == 0:
        m, n = n, m
    while m != 0:
        m, n = n%m, m
    return n

你可能感兴趣的:(python)