fork download
  1. -module(prog).
  2. -export([main/0]).
  3.  
  4. main() ->
  5. loop().
  6. loop() ->
  7. case io:fread( "","~d" ) of
  8. eof ->
  9. true;
  10. {ok, X} ->
  11. [Y] = X,
  12. if
  13. Y == 42 ->
  14. true;
  15. true ->
  16. io:fwrite( "~B\n",X ),
  17. loop()
  18. end
  19. end.
Success #stdin #stdout 0.05s 23464KB
stdin
1
2
10
42
11
stdout
1
2
10