Skip to content

Instantly share code, notes, and snippets.

@return0927
Created July 14, 2019 14:34
Show Gist options
  • Save return0927/887cc55b6562f284369f2dd5ba71f0b5 to your computer and use it in GitHub Desktop.
Save return0927/887cc55b6562f284369f2dd5ba71f0b5 to your computer and use it in GitHub Desktop.
# 유클리드 호제법
def euclidean_gcd(x, y):
while(y):
x, y = y, x % y
return x
# 재귀함수
def recursive_gcd(a,b):
if(b==0):
return a
else:
return recursive_gcd(b,a%b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment