Advertisement
PaolaD

Untitled

Aug 13th, 2020
962
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.35 KB | None | 0 0
  1. (define listica (cons 6 (cons 7 (cons 8 (cons 9 (cons 7 (cons 9 empty)))))))
  2.  
  3. (define (Par lista)
  4.   (cond
  5.     [(not (list? lista)) "Ingrese una lista"]
  6.     [(empty? lista) empty]
  7.     [(even? (first lista)) (cons (first lista) (Par (rest lista)))]
  8.     [else (Par (rest lista))]
  9.     ))
  10.  
  11. (Par (cons 2 (cons 100 (cons 29 (cons 43 (cons 102 empty))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement