[archives] [homepage]

Problem 1.3
Friday, August 23, 2019; ago; Download .md

Find the smallest, then add the other two.

(define (sum a b c)
  (cond ((and (< a b) (< a c))
         (+ (square b) (square c)))
        ((and (< b a) (< b c))
         (+ (square a) (square c)))
        (else (+ (square a) (square b)))))

(define (square x) (* x x))