Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.21 KB | None | 0 0
  1.  
  2. (defun cnt (lst el)
  3.     (if (eq nil lst)
  4.         0
  5.         (if (eq (car lst) el)
  6.             (+ 1 (cnt (cdr lst) el))
  7.             (cnt (cdr lst) el)
  8.         )
  9.     )
  10. )
  11.  
  12. (print (cnt (list 1 2 1 3 4 1 2 1) 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement