2014년 3월 29일 토요일

Euler Project: Problem 16

215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 21000?

Prelude Data.List.Split> sum $ map (\x -> read x :: Int) $ chunksOf 1 $ show $ 2^1000
1366

댓글 없음:

댓글 쓰기