Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (parzysta n)
- (if (= n 0)
- #t
- (if (< n 0)
- #f
- (parzysta (- n 2)
- ))))
- (define (fib n)
- (if (< n 3)
- 1
- (+ (fib (- n 2)) (fib (- n 1)))))
- (define (ileL n)
- (if (number? n)
- 1
- (+ (ileL (car n)) (ileL (cdr n)))))
- (define (nalezy? n lst)
- (if (null? lst)
- #f
- (if (equal? (car lst) n)
- #t
- (nalezy? n (cdr lst)))))
- (define (polacz lst1 lst2)
- (if (null? lst1)
- lst2
- (cons (car lst1) (polacz (cdr lst1) lst2))))
- (define (podziel2 lst)
- (if (null? lst)
- lst
- (cons (/ (car lst) 2) (podziel2 (cdr lst)))))
- (define (silniaIT n)
- (silniaITpom n 1))
- (define (silniaITpom n accumulator)
- (if (= n 1)
- accumulator
- (silniaITpom (- n 1) (* accumulator n))))
- (define (podziel2IT lst)
- (podziel2ITpom lst '()))
- (define (podziel2ITpom lst accumulator)
- (if (null? lst)
- accumulator
- (podziel2ITpom (cdr lst) (append accumulator (list (/ (car lst) 2))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement