fork download
  1. n=0
  2. a=[]
  3. a<<(n=gets.to_i) until n==-1
  4. for i in 0..a.size-1
  5. puts a[i] unless a[i]==-1
  6. end
Success #stdin #stdout 0s 4760KB
stdin
2
3
4
-1
stdout
2
3
4