Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dobros :: [Float] -> [Float]
- dobros [] = []
- dobros [x] = [2*x]
- dobros (x:y) = 2*x : (dobros y)
- numOcorre :: Char -> String -> Int
- numOcorre x [] = 0
- numOcorre x (y:z) = if x == y then 1 + numOcorre x z else numOcorre x z
- positivos :: [Int] -> Bool
- positivos [x] = if x<0 then False else True
- positivos (x:y) = if x<0 then False else positivos y
- soPos :: [Int] -> [Int]
- soPos [] = []
- soPos (x:y) = if x <= 0 then soPos y else x:(soPos y)
- --soNeg :: [Int] -> [Int]
- --soNeg [] = []
- --soNeg (x:y) = if x >= 0 then soNeg y else x:(soNeg y)
- somaNeg :: [Int] -> Int
- somaNeg [] = 0
- somaNeg (x:y) = if x < 0 then x + somaNeg y else somaNeg y
- tresUlt :: [a] -> [a]
- tresUlt [] = []
- tresUlt (x:y) = if length (x:y) <= 3 then (x:y) else tresUlt y
- segundos :: [(a,b)] -> [b]
- segundos [] = []
- segundos (x,y) = y:segundos (x:y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement