fork download
  1. def NWD(a, b)
  2. if b==0
  3. return a
  4. return NWD(b, a%b)
  5. end
  6.  
  7. while true
  8. begin
  9. a = gets.split
  10. rescue
  11. break
  12. end
  13. for i in 0..a[0].to_i + 1
  14. if i == 0
  15. temp = a[i+1].to_i
  16. else
  17. temp=NWD(temp,a[i].to_i)
  18. end
  19. end
  20. puts temp
  21. end
Runtime error #stdin #stdout 0s 4760KB
stdin
Standard input is empty
stdout
Standard output is empty