Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Repetido where
- repetido :: Int -> [Int] -> Int
- repetidoAux :: Int -> [Int] -> Int -> Int
- repetido n lista = repetidoAux n lista 0
- repetidoAux n lista i = if(n>length(lista))
- then i else
- (if(n==head(lista))
- then ((repetidoAux n (tail lista) (i+1)))
- else repetidoAux n (tail lista) i)
Add Comment
Please, Sign In to add comment