Skip to content

Instantly share code, notes, and snippets.

@a1ip
Created September 19, 2013 21:30
Show Gist options
  • Save a1ip/6630126 to your computer and use it in GitHub Desktop.
Save a1ip/6630126 to your computer and use it in GitHub Desktop.
(define (square a) (* a a))
(define (sum-of-squares a b) (+ (square a) (square b)))
(define (sum-of-two-greatest-squares a b c)
(cond ((and (>= a c) (>= b c)) (sum-of-squares a b))
((and (>= a b) (>= c b)) (sum-of-squares a c))
(else (sum-of-squares b c))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment