Skip to content

Instantly share code, notes, and snippets.

@ufocoder
Created January 27, 2019 05:35
Show Gist options
  • Save ufocoder/8479ac12c83d3b5c698fd9da56c35e49 to your computer and use it in GitHub Desktop.
Save ufocoder/8479ac12c83d3b5c698fd9da56c35e49 to your computer and use it in GitHub Desktop.
def gcd(a, b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return a + b
def main():
a, b = map(int, input().split())
print(gcd(a, b))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment