Created
April 27, 2018 13:29
-
-
Save enomoto/7e77cf1cf19e2cb3531303fa6621de5f to your computer and use it in GitHub Desktop.
SICP excercise 1.3
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
#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