Problem 67
Problem18と同じプログラムで解けるので。
p67 = do fh <- openFile "triangle.txt" ReadMode c <- hGetContents fh let triangle = map (\line -> map (\s -> read s::Integer) $ words line) $ lines c putStr $ show $ maximum $ p18 triangle
Problem18と同じプログラムで解けるので。
p67 = do fh <- openFile "triangle.txt" ReadMode c <- hGetContents fh let triangle = map (\line -> map (\s -> read s::Integer) $ words line) $ lines c putStr $ show $ maximum $ p18 triangle