Advertisement
HeroBaga

Untitled

Oct 22nd, 2021
3,483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.30 KB | None | 0 0
  1. ;Удаление нечётных элеметнтов
  2. (define (remove_odd_tail lst i)
  3.   (cond
  4.     [(null? lst) '()]
  5.     [(odd? i) (cons (car lst) (remove_odd_tail (cdr lst) (+ i 1)))]
  6.     [else (remove_odd_tail (cdr lst) (+ i 1))]
  7.   )
  8. )
  9. (remove_odd_tail (list 10 20 30 40 50 60 70 80 90 100) 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement