A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
17
Task/Five-weekends/PicoLisp/five-weekends.l
Normal file
17
Task/Five-weekends/PicoLisp/five-weekends.l
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(setq Lst
|
||||
(make
|
||||
(for Y (range 1900 2100)
|
||||
(for M (range 1 12)
|
||||
(and
|
||||
(date Y M 31)
|
||||
(= "Friday" (day (date Y M 1)))
|
||||
(link (list (get *Mon M) Y)) ) ) ) ) )
|
||||
|
||||
(prinl "There are " (length Lst) " months with five weekends:")
|
||||
(mapc println (head 5 Lst))
|
||||
(prinl "...")
|
||||
(mapc println (tail 5 Lst))
|
||||
(prinl)
|
||||
(setq Lst (diff (range 1900 2100) (uniq (mapcar cadr Lst))))
|
||||
(prinl "There are " (length Lst) " years with no five-weekend months:")
|
||||
(println Lst)
|
||||
Loading…
Add table
Add a link
Reference in a new issue