1 2 3 4 5 | main = do putStrLn "Sum all natural numbers from 1 to? " integerInput <- getLine putStrLn (show (sum ([1..(read integerInput)]))) |
bWFpbiA9ICBkbwogICAgICAgIHB1dFN0ckxuICJTdW0gYWxsIG5hdHVyYWwgbnVtYmVycyBmcm9tIDEgdG8/ICIKICAgICAgICBpbnRlZ2VySW5wdXQgPC0gZ2V0TGluZQogICAgICAgIHB1dFN0ckxuIChzaG93IChzdW0gKFsxLi4ocmVhZCBpbnRlZ2VySW5wdXQpXSkpKQogICAgICAgIA==
-
upload with new input
-
result: Success time: 0.01s memory: 3716 kB returned value: 0
5
Sum all natural numbers from 1 to? 15
-
result: Runtime error time: 0.01s memory: 3716 kB signal: -1
Sum all natural numbers from 1 to?
prog: <stdin>: hGetLine: end of file



