小题练习

2018-04-16  本文已影响0人  vckah
def isPrime(n):
    if n <= 1:
        return Flase
    i = 2
    while i*i <= n:
        if n%i == 0:
            return Flase
        i += 1
    return True
def gcd(a, b):
    # return the GCD of a and b using Euclid's Algorithm
    while a != 0:
        a, b = b % a, a
    return b
上一篇下一篇

猜你喜欢

热点阅读