Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Project Euler Problem 8 with hs
import Data.Char
main = do
l <- getLine
let nums = map digitToInt l
putStrLn $ show $ maxNum nums
maxNum :: [Int] -> Int
maxNum [] = 0
maxNum all@(x:xs) = max (product (take 5 all)) (maxNum xs)
Owner

aomoriringo commented Sep 9, 2012

入力するファイルには数字が入ってます。(改行はなくして保存してるのでちょっとずるしてます)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment