10 lines
190 B
Haskell
10 lines
190 B
Haskell
|
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
|