euler/haskell/e016.hs

10 lines
190 B
Haskell
Raw Normal View History

2015-01-04 23:52:50 +01:00
import Data.Char
myPow :: Integral a => a -> a -> a
myPow x 0 = 1
myPow x 1 = x
myPow x n = x*(myPow x (n-1))
--digitSum :: Integral a => a -> a
digitSum x = sum $ map digitToInt $ show x