sicp-solutions/ex-1.03.scm

10 lines
262 B
Scheme

#| BEGIN (Write your solution here) |#
(define (sqr x) (* x x))
(define (solution a b c)
(cond ((and (<= a b) (<= a c))
(+ (sqr b) (sqr c)))
((and (<= b a) (<= b c))
(+ (sqr a) (sqr c)))
(else (+ (sqr a) (sqr b)))))
#| END |#