Skip to content

Instantly share code, notes, and snippets.

@mathias
Created October 4, 2010 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathias/610670 to your computer and use it in GitHub Desktop.
Save mathias/610670 to your computer and use it in GitHub Desktop.
(define (sum-of-largest-squares x y z)
(cond
((and (>= x y) (>= y z)) (sum-of-squares x y))
((and (>= y x) (>= x z)) (sum-of-squares x y))
((and (>= x y) (>= z y)) (sum-of-squares x z))
(else (sum-of-squares y z))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment