commit deletes
This commit is contained in:
parent
776bba907c
commit
372c577f83
233 changed files with 0 additions and 6724 deletions
|
|
@ -1,22 +0,0 @@
|
|||
;; Solution 1:
|
||||
(defun fizzbuzz ()
|
||||
(loop for x from 1 to 100 do
|
||||
(princ (cond ((zerop (mod x 15)) "FizzBuzz")
|
||||
((zerop (mod x 3)) "Fizz")
|
||||
((zerop (mod x 5)) "Buzz")
|
||||
(t x)))
|
||||
(terpri)))
|
||||
|
||||
;; Solution 2:
|
||||
(defun fizzbuzz ()
|
||||
(loop for x from 1 to 100 do
|
||||
(format t "~&~{~A~}"
|
||||
(or (append (when (zerop (mod x 3)) '("Fizz"))
|
||||
(when (zerop (mod x 5)) '("Buzz")))
|
||||
(list x)))))
|
||||
|
||||
;; Solution 3:
|
||||
(defun fizzbuzz ()
|
||||
(loop for n from 1 to 100
|
||||
do (format t "~&~[~[FizzBuzz~:;Fizz~]~*~:;~[Buzz~*~:;~D~]~]~%"
|
||||
(mod n 3) (mod n 5) n)))
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
for i = 1:100
|
||||
if i % 15 == 0
|
||||
println("FizzBuzz")
|
||||
elseif i % 3 == 0
|
||||
println("Fizz")
|
||||
elseif i % 5 == 0
|
||||
println("Buzz")
|
||||
else
|
||||
println(i)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue