Skip to content

Instantly share code, notes, and snippets.

@BaseCase
Created September 3, 2008 15:11
Show Gist options
  • Save BaseCase/8604 to your computer and use it in GitHub Desktop.
Save BaseCase/8604 to your computer and use it in GitHub Desktop.
;Exercise 1.3 - Define a procedure that takes three numbers
; and returns the sum of the squares of the two larger numbers.
(define (sum-of-squares a b)
(+ (* a a) (* b b)))
(define (foo a b c)
(cond ((and (>= a c) (>= b c)) (sum-of-squares a b))
((and (>= a b) (>= c b)) (sum-of-squares a c))
((and (>= b a) (>= c a)) (sum-of-squares b c))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment