fork(1) download
  1. a = int(input())
  2. b = int(input())
  3.  
  4. while a != b:
  5. if a > b:
  6. a = a - b
  7. else:
  8. b = b - a
  9. print ("NWD =", a)
Success #stdin #stdout 0.01s 7332KB
stdin
16
3
stdout
('NWD =', 1)