You are viewing a single comment's thread. Return to all comments →
Haskell
import Control.Applicative import Control.Monad import System.IO import Data.Char main :: IO () main = do t_temp <- getLine let t = read t_temp :: Int forM_ [1..t] $ \a0 -> do n_temp <- getLine let n = read n_temp :: Int let num = 2^n let num_string = show num let digits = map (\x -> digitToInt x) num_string print(sum digits)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #16: Power digit sum
You are viewing a single comment's thread. Return to all comments →
Haskell