Input/Output for lines of text: Difference between revisions
Haskell - Update to read N lines
(C++ entry) |
(Haskell - Update to read N lines) |
||
Line 414:
=={{header|Haskell}}==
<lang Haskell>import Control.Monad
main = do
number <- getLine
input <- replicateM (read number) getLine
</lang>▼
mapM_ putStrLn input
</lang>'''Input:'''
<pre>
3
hello
hello world
Pack my Box with 5 dozen liquor jugs
{{out}}
<pre>
hello
hello world
Pack my Box with 5 dozen liquor jugs
</pre>
=={{header|J}}==
|