8 lines
190 B
Haskell
8 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)
|