Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sumd2 0 acc = acc
- sumd2 x acc = sumd2 (x `div` 10) (acc + (x `mod` 10))
- main = do
- input1 <- getLine
- let num = read input1 :: Integer
- let sum2 = sumd2 num 0
- putStrLn(show(sum2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement