Skip to content
Snippets Groups Projects
Select Git revision
  • 0112bbacff866f6c8004745ec3af4134653627b6
  • master default
  • zs2021
  • zs1920
4 results

euklides-modulici.py

Blame
  • euklides-modulici.py 245 B
    #!/usr/bin/env python3
    # Největší společný dělitel: Euklidův algoritmus s modulem
    
    x = int(input())
    y = int(input())
    
    while x > 0 and y > 0:
        if x > y:
            x %= y
        else:
            y %= x
    
    if x > 0:
        print(x)
    else:
        print(y)