Advertisement
iavellaneda

haskell_listas

Apr 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sacaimpares xs = filter (\x -> even x) xs
  2. mayor [x] = x
  3. mayor (x:xs) =  if x > mayor xs then x else mayor xs
  4. mayor2 [x] = x
  5. mayor2 (x:xs)
  6.     | x > mayor2 xs = x
  7.     | otherwise = mayor2 xs
  8.  
  9. mitadpares [0] = 0
  10. mitadpares (x:xs) = if even x then x `div` 2 :mitadpares xs else x:mitadpares xs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement