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.

Revisions

  1. ufocoder created this gist Jan 27, 2019.
    15 changes: 15 additions & 0 deletions gcd.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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()