Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #lang racket
- (define (parity x . l)
- (define (check-parity y)
- (not (xor (= (remainder x 2) 0)
- (= (remainder y 2) 0))))
- (cond ((null? l) '())
- ((check-parity (car l))
- (cons (car l) (apply parity x (cdr l))))
- (else (apply parity x (cdr l)))))
- (parity 1 2 3 4 5 6 7 8 9)
Advertisement
Add Comment
Please, Sign In to add comment