Permalink
Browse files

改正了第17题,加上了对and单词的修正。

  • Loading branch information...
1 parent 7fdc7b2 commit 2ea97a8e8f0e664cd27038d0a1b483a85ab8a7c0 @Liutos committed Aug 29, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lisp/pro17.lisp
View
@@ -2,8 +2,10 @@
(let ((cnt 0))
(loop
:for i from 1 upto n
- :do (incf cnt (count-if #'(lambda (c)
- (and (char/= #\Space c)
- (char/= #\- c)))
- (format nil "~R" i))))
+ :do (incf cnt
+ (+ (count-if #'(lambda (c)
+ (and (char/= #\Space c)
+ (char/= #\- c)))
+ (format nil "~R" i))
+ (if (and (> i 100) (/= 0 (rem i 100))) 3 0))))
cnt))

0 comments on commit 2ea97a8

Please sign in to comment.