lambdabot

Untitled

Jul 21st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.23 KB | None | 0 0
  1. (defun fib ( n &optional (a 1) (b 0))
  2.   (if (= n 0)
  3.       a
  4.       (fib (- n 1) b (+ a b))))
  5.  
  6. ;; le argumento para FIB do teclado
  7. (setq a (read-line))
  8. ;; escreve na tela e analisa um inteiro para FIB
  9. (write (fib (parse-integer a)))
Advertisement
Add Comment
Please, Sign In to add comment