Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
Forked from redsquirrel/gist:189192
Created September 25, 2009 03:19
Show Gist options
  • Save ryanbriones/193268 to your computer and use it in GitHub Desktop.
Save ryanbriones/193268 to your computer and use it in GitHub Desktop.
SICP Exercise 1.3
SICP 1.3
Fork me. Solve me.
====
(define (square x) (* x x))
(define (sum-of-squares a b) (+ (square a) (square b)))
(define (sum-two-largest-squares a b c)
(cond ((and (< a b) (< a c))
(sum-of-squares b c))
((and (< b a) (< b c))
(sum-of-squares a c))
(else
(sum-of-squares a b)) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment