Created
January 27, 2019 05:35
-
-
Save ufocoder/8479ac12c83d3b5c698fd9da56c35e49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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