标签:and 约数 gcd return == pre sum gyp lse
def egypt(x,y):
sum = 0
while x != 0:
if x % 2 == 1
sum = sum + y
x = x //2
y = y *2
return sum
def gcd(x,y):
while (x != 0) and (y !=0):
if x > y:
x = x -y
else:
y = y -x
if x == 0:
return y
else :
return x
标签:and 约数 gcd return == pre sum gyp lse
原文地址:https://www.cnblogs.com/Stephanie-boke/p/11711320.html