mirror of
https://github.com/Xevion/lisp-projects.git
synced 2025-12-06 09:15:33 -06:00
11 lines
397 B
Common Lisp
11 lines
397 B
Common Lisp
(defun read-3-numbers-&-format-sum ()
|
|
(flet ((prompt (string)
|
|
(format t "~&~a: " string)
|
|
(finish-output)
|
|
(read nil 'eof nil)))
|
|
(let ((x (prompt "first number"))
|
|
(y (prompt "second number"))
|
|
(z (prompt "third number")))
|
|
(format t "~&the sum of ~a, ~a, & ~a is:~%~%~a~%"
|
|
x y z (+ x y z)))))
|
|
(read-3-numbers-&-format-sum) |