You are viewing a single comment's thread. Return to all comments →
Haskell
import Control.Applicative import Control.Monad import System.IO import Prelude main :: IO () main = do t_temp <- getLine let t = read t_temp :: Int n_temp <- getMultipleLines t let n = map (read :: String -> Integer) n_temp :: [Integer] let summed = sum n print(read (take 10 (show summed)) :: Int) getMultipleLines :: Int -> IO [String] getMultipleLines n | n <= 0 = return [] | otherwise = do x <- getLine xs <- getMultipleLines (n-1) let ret = (x:xs) return ret
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #13: Large sum
You are viewing a single comment's thread. Return to all comments →
Haskell