Guest User

Untitled

a guest
Jan 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Repetido where
  2.  
  3. repetido :: Int -> [Int] -> Int
  4. repetidoAux :: Int -> [Int] -> Int -> Int
  5.  
  6. repetido n lista = repetidoAux n lista 0
  7. repetidoAux n lista i = if(n>length(lista))
  8.                             then i else
  9.                                     (if(n==head(lista))
  10.                                         then ((repetidoAux n (tail lista) (i+1)))
  11.                                             else repetidoAux n (tail lista) i)
Add Comment
Please, Sign In to add comment