fork download
  1. |c number|
  2. [
  3. number:=0.
  4. [ (c := stdin next) asciiValue ~= 10 ]
  5. whileTrue:
  6. [number := (number * 10) + (c asciiValue) - 48.].
  7. number ~= 42
  8. ]
  9. whileTrue:
  10. [Transcript show: number printString; cr.]
  11. !
Success #stdin #stdout 0.01s 7896KB
stdin
1
2
10
42
11
stdout
1
2
10