1
0
Fork 0
This commit is contained in:
Arthur K. 2025-05-29 19:24:43 +03:00
commit 810a9654a4
Signed by: wzray
GPG key ID: B97F30FDC4636357
50 changed files with 4450 additions and 0 deletions

14
4/H.hs Normal file
View file

@ -0,0 +1,14 @@
import qualified Data.ByteString.Char8 as BS
import Data.Maybe (listToMaybe, catMaybes)
readInteger :: BS.ByteString -> Maybe Integer
readInteger bs = case BS.readInteger bs of
Just (x, _) -> Just x
Nothing -> Nothing
main :: IO ()
main = do
input <- BS.getContents
let numbers = catMaybes (map readInteger (tail (BS.lines input)))
total = sum numbers
print total