Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define nth-digit
- (lambda (cislo pocet-c cifra)
- (if (< pocet-c cifra)
- (display "Uživateli, Vaše číslo musí být menší než počet cifer čísla")
- ((lambda (pom)
- (modulo pom 10))
- (quotient cislo (expt 10 (- pocet-c cifra)))))))
- (nth-digit 276935 6 8)
- (define my-xor
- (lambda (x y)
- (if (equal? x y)
- #f
- #t)))
- (my-xor #f #t)
- (define max3
- (lambda (x y z)
- ((lambda (max2)
- (if (< max2 z)
- z
- max2))
- (if (> x y)
- x
- y))))
- (max3 3 2 1)
- (define cylinder-volume
- (lambda (r v)
- (* pi (* r r) v)))
- (define cylinder-height
- (lambda (r uhel)
- (/ (* 2 r) (tan uhel))))
- (define vase-weight
- (lambda (r1 v1 t1 t2)
- (let* ((r2 (- r1 t1))
- (v2 (cylinder-height r1 (/ pi 4)))
- (v3 (- v1 t1 t2))
- (v4 (cylinder-height r2 (/ pi 4))))
- (*
- 2400
- (/
- (-
- (-
- (* (* r1 r1) v1 pi)
- (/ (* (* r1 r1) v2 pi) 2))
- (-
- (* (* r2 r2) v3 pi)
- (/ (* (* r2 r2) v4 pi) 2)))
- 1000000)))))
- (cylinder-volume 5 20)
- (cylinder-height 5 (/ pi 4))
- (vase-weight 5 20 1 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement