7 lines
190 B
Haskell
7 lines
190 B
Haskell
toList :: String -> [Integer]
|
|
toList input = read ("[" ++ input ++ "]")
|
|
|
|
main = do
|
|
putStrLn "Enter a list of numbers (separated by comma):"
|
|
input <- getLine
|
|
print $ sum (toList input)
|