Ladies_Man

День недели

Dec 17th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.27 KB | None | 0 0
  1. (define (day-of-week x y z)
  2.   (let* (
  3.          (a (quotient (- 14 y) 12))
  4.          (m (- z a))
  5.          (k (- (+ y (* 12 a)) 2)))
  6.          (remainder (+ 7000 (+(- (+ x m (quotient m 4)) (quotient m 100)) (quotient m 400) (quotient (* 31 k) 12))) 7
  7.         )
  8.    )
  9. )
Advertisement
Add Comment
Please, Sign In to add comment