Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import System.IO
- loadList :: Handle -> IO[(String, Int)]
- loadList handle = do
- contents <- hGetContents handle
- let allLines = lines contents
- let lines = init(tail allLines)
- let rez = zip (concat[take 1 (words line) | line <- lines]) [((((read y::Int)*100)+(read m::Int))*100)+(read d::Int) | [d,m,y] <- [[(x) | x <- tail (words line)] | line <- lines]]
- return rez
- main = do
- file <- openFile "input.txt" ReadMode
- wordList <- loadList file
- print (fst ((filter ((==(maximum [snd x | x <- wordList])).snd) wordList)!!0))
- print (fst ((filter ((==(minimum [snd x | x <- wordList])).snd) wordList)!!0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement