Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun nombres (liste)
- (cond
- ((atom liste) 0)((atom (car liste)) 0)
- ((and (numberp (caar liste)) (+ (nombres (cdr liste)) 1)))
- (t (nombres (cdr liste))) ) )
- [67]> (nombres '((a b d) (5 g) (7 m)))
- 2
- [68]> (nombres '((a b d) (5 g) g (7 m)))
- 1
- [69]> (defun nombres (liste)
- (cond
- ((atom liste) 0)((atom (car liste)) 0)
- ((listp (car liste))(and (numberp (caar liste)) (+ (nombres (cdr liste)) 1))) (t (nombres (cdr liste))) ) )
- NOMBRES
- [70]> (nombres '((a b d) (5 g) g (7 m) m))
- NIL
- (nombres '((a b d) a (5 g) (b) (7 m) j (8 h l g)))
- 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement