fork download
  1. def euclid(a,b):
  2.  
  3. while a!=b:
  4. if a > b:
  5. a = a - b
  6. else:
  7. b = b - a
  8. return a
  9.  
  10. a = int(raw_input())
  11. b = int(raw_input())
  12.  
  13. print euclid(a,b)
Success #stdin #stdout 0.01s 7244KB
stdin
14
4
stdout
2