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
doStuff = putStrLn
number <- getLine
main = getContents >>= mapM_ doStuff.tail.lines
input <- replicateM (read number) getLine
</lang>
mapM_ putStrLn input
</lang>'''Input:'''
<pre>
3
hello
hello world
Pack my Box with 5 dozen liquor jugs
</langpre>
{{out}}
<pre>
hello
hello world
Pack my Box with 5 dozen liquor jugs
</pre>
 
=={{header|J}}==
125

edits