Untitled


SUBMITTED BY: antoineh1

DATE: May 8, 2016, 8:31 p.m.

FORMAT: Text only

SIZE: 339 Bytes

HITS: 4053

  1. ; Sucet poslednych 2 prvkov lin. zoznamu
  2. (defun last1 (N)
  3. (cond
  4. ((NULL N) nil)
  5. ((NULL (rest N)) (first N))
  6. (t (last1 (rest N)))
  7. )
  8. )
  9. (defun last2 (N)
  10. (cond
  11. ((NULL N) nil)
  12. ((NULL (rest N)) (first S))
  13. (t (last1 (rest N)))
  14. )
  15. )
  16. (defun sucet_last (N)
  17. (+ (last1(N)) (last2(N)))
  18. )
  19. (sucet_last '(1 2 3) )

comments powered by Disqus