Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ref::String->Int
- ref tipo | tipo == "cafe" = 8
- | tipo == "almoco" = 12
- | tipo == "jantar" = 10
- tot::[String]->Int
- tot [] = 0
- tot (f:r) = (ref f) + (tot r)
- getList::Int->[IO String]
- getList 0 = []
- getList n = [a | a<-[getNumber] ] ++ getList(n-)
- getNumber::IO String
- getNumber = do
- s <- getLine
- return s
- main::IO()
- main = do
- n <- getLine
- arr <- sequence(getList (read n))
- print (tot arr)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement