blob: db618e4e97b5d41c6332b8b97718e93ee9aa8f36 (
plain) (
tree)
|
|
(define (sumsquare a b)
(if (> a b)
0
(+ (* a a) (sumsquare (+ a 1) b)) ))
(define (sumcube a b)
(if (> a b)
0
(+ (* a a a) (sumcube (+ a 1) b)) ))
(define (sum fn a b)
(if (> a b)
0
(+ (fn a) (sum fn (+ a 1) b))))
(define (square x)
(* x x))
(define (cube x)
(* x x x))
|