-
-
Save expipiplus1/1da20d12f653287f78688ef37844e8f8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad (replicateM) | |
-- | Read an integer, n, on one line and read n values on subsequent lines | |
readCount :: Read a => IO [a] | |
readCount = do | |
n <- readLn | |
replicateM n readLn | |
main = do | |
ints <- readCount | |
print (sum ints) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment