Skip to content

Instantly share code, notes, and snippets.

@enomoto
Created April 27, 2018 13:29
Show Gist options
  • Save enomoto/7e77cf1cf19e2cb3531303fa6621de5f to your computer and use it in GitHub Desktop.
Save enomoto/7e77cf1cf19e2cb3531303fa6621de5f to your computer and use it in GitHub Desktop.
SICP excercise 1.3
#lang racket
(define (sum_of_square a b c)
(cond ((< a b) (< a c) (+ (* b b) (* c c)))
((< b c) (< b a) (+ (* a a) (* c c)))
(else (+ (* a a) (* b b)))
)
)
(sum_of_square 3 4 5) ;41
(sum_of_square 8 4 5) ;89
(sum_of_square 3 2 1) ;13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment