Code Review

Compare your solutions

    #| BEGIN (Введите свое решение) |#
(define (max-first x y z)
  (cond
    ((and (> x y) (> x z)) x)
    ((and (> y x) (> y z)) y)
    (else z)))

(define (max-second x y z)
  (cond
    ((or (and (> x y) (< x z))
         (and (> x z) (< x y))) x)
    ((or (and (> y x) (< y z))
         (and (> y z) (< y x))) y)
    (else z)))

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

(define (sum-of-squares x y)
  (+ (square x) (square y)))

(define (solution x y z)
  (sum-of-squares (max-first x y z)
                  (max-second x y z)))
#| END |#