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

euklides-modulici.py

Blame
  • Martin Mares's avatar
    Martin Mareš authored
    Též přesunuty příklady, které přetekly z 01.
    7fbad72b
    History
    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)