Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
15
Task/Nth/Common-Lisp/nth.lisp
Normal file
15
Task/Nth/Common-Lisp/nth.lisp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defun add-suffix (number)
|
||||
(let* ((suffixes #10("th" "st" "nd" "rd" "th"))
|
||||
(last2 (mod number 100))
|
||||
(last-digit (mod number 10))
|
||||
(suffix (if (< 10 last2 20)
|
||||
"th"
|
||||
(svref suffixes last-digit))))
|
||||
(format nil "~a~a" number suffix)))
|
||||
|
||||
(loop for (low high) in '((0 25) (250 265) (1000 1025))
|
||||
do (progn
|
||||
(format t "~a to ~a: " low high)
|
||||
(loop for n from low to high
|
||||
do (format t "~a " (add-suffix n))
|
||||
finally (terpri))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue