Improved project structure.
This commit is contained in:
8
haskell/e020.hs
Normal file
8
haskell/e020.hs
Normal file
@@ -0,0 +1,8 @@
|
||||
import Data.Char (digitToInt)
|
||||
|
||||
factorial :: Integer -> Integer
|
||||
factorial 1 = 1
|
||||
factorial x = x * factorial (x - 1)
|
||||
|
||||
sumDigits :: Integer -> Int
|
||||
sumDigits = sum . map digitToInt . show
|
||||
Reference in New Issue
Block a user