exercise 1: calculate the sum of squares
(define (>= x y)(not (< x y)))
(define (square a)(* a a))
(define (answer x y z)
(cond ( (and (>= x z) (>= y z)) (+ (square x) (square y)))
( (and (>= y x) (>= z x)) (+ (square y) (square z)))
( (and (>= z y) (>= x y)) (+ (square z) (square x)))
)
)
沒有留言:
張貼留言