Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sumDigits n =
- if null n
- then 0
- else (read [(head n)] :: Integer) + (sumDigits (tail n))
- main= do
- line <- getLine
- --let num = read line :: Integer
- --print(read (sumDigits line) :: Integer)
- print(sumDigits line)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement