You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
337 B
Racket

(define (square x) (* x x))
(define (sum-of-squares x y) (+ (square x) (square y)))
(define (is-first-least? a b c) (and (< a b) (< a c)))
(define a 9)
(define b 1)
(define c 10)
(cond ((is-first-least? c a b)(sum-of-squares a b))
((is-first-least? a c b)(sum-of-squares c b))
((is-first-least? b a c)(sum-of-squares a c)))