Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Middle-three-digits/NewLISP/middle-three-digits.l
Normal file
11
Task/Middle-three-digits/NewLISP/middle-three-digits.l
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(define (middle3 x)
|
||||
(if (even? (length x))
|
||||
(println "You entered " x ". I need an odd number of digits, not " (length x) ".")
|
||||
(if (< (length x) 3)
|
||||
(println "You entered " x ". Sorry, but I need 3 or more digits.")
|
||||
(println "The middle 3 digits of " x " are " ((- (/ (- (length x) 1) 2) 1) 3 (string (abs x))) ".")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(map middle3 lst)
|
||||
Loading…
Add table
Add a link
Reference in a new issue