Created
September 3, 2008 15:11
-
-
Save BaseCase/8604 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;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