Skip to content

Instantly share code, notes, and snippets.

@zigzackey
Created March 29, 2016 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zigzackey/b48d2b41bbfeb9dec3cc to your computer and use it in GitHub Desktop.
Save zigzackey/b48d2b41bbfeb9dec3cc to your computer and use it in GitHub Desktop.
def gcd(a, b):
if a < b:
tmp = a
a = b
b = tmp
r = a % b
while r != 0:
a = b
b = r
r = a % b
return b
if __name__ == '__main__':
l = list(map(int, input().split()))
x = l[0]
y = l[1]
ans = gcd(x, y)
print(ans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment