fork(1) download
  1. # s. 21 rys. 3
  2. # Funkcja realizująca algorytm Euklidesa w wersji z odejmowaniem
  3. def nwd(a, b):
  4. while a != b:
  5. if a > b:
  6. a = a -b
  7. else:
  8. b = b - a
  9. return a
  10.  
  11. print(nwd(25, 35))
  12. print(nwd(39,12))
Success #stdin #stdout 0.03s 9496KB
stdin
Standard input is empty
stdout
Standard output is empty