Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ;Exercise 1.3 - Define a procedure that takes three numbers
  2. ; and returns the sum of the squares of the two larger numbers.
  3.  
  4. (define (sum-of-squares a b)
  5. (+ (* a a) (* b b)))
  6.  
  7. (define (foo a b c)
  8. (cond ((and (>= a c) (>= b c)) (sum-of-squares a b))
  9. ((and (>= a b) (>= c b)) (sum-of-squares a c))
  10. ((and (>= b a) (>= c a)) (sum-of-squares b c))))
Add Comment
Please, Sign In to add comment