Created
April 2, 2019 04:43
-
-
Save curegit/5c10c16651549292a3d146ceba814b6b to your computer and use it in GitHub Desktop.
Common Lisp で FizzBuzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun fizzbuzz (n) | |
(loop for i from 1 to n | |
do (cond ((equal (mod i 15) 0) (format t "~%fizzbuzz")) | |
((equal (mod i 5) 0) (format t "~%buzz")) | |
((equal (mod i 3) 0) (format t "~%fizz")) | |
(t (print i))))) | |
(defun fizzbuzz-main () | |
(fizzbuzz 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment