提示是定义一个过程,该过程返回三个数字中最大的两个的平方和。
我知道这不是一个优雅的解决方案,但这是我一起破解的:
(define (largest-of-two-sum-of-squares x y z)
(cond ((and (< x y) (< x z)) (sum-of-squares y z))
((and (< y z) (< y x)) (sum-of-squares x z))
((and (< z x) (< z y)) (sum-of-squares x y)))))
我想知道为什么我会出错。
;The object 85 is not applicable
顺便说一句,单词 object 后面的数字始终是正确答案。我是一个方案初学者,它一定是我的语法吗?
谢谢