这里 http://code.google.com/p/jrm-code-project/wiki/ProgrammingArt
Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.
(define (sum-square-largest x y z)
(cond ((and (< x y) (< x z)) ;; x is smallest
(+ (* y y) (* z z)))
(else (sum-square-largest y z x))))
本文介绍了一个简单的程序设计问题:定义一个过程,接受三个数值作为参数,并返回这三个数中两个较大数值的平方和。该过程通过条件判断确定最小值,并据此计算剩余两数的平方和。

被折叠的 条评论
为什么被折叠?



