提示是定义一个返回三个数字中两个最大值的平方和的过程。SICP练习中的错误(练习1.3)
我知道这不完全是一个完美的解决方案,但是这是我砍死在一起:
(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
单词对象后面的数字总是正确的答案,顺便说一句。我是一个计划初学者,它必须是我的语法中的东西?
谢谢
你有一个多余的右括号。 – 2012-03-10 17:13:59
6 6 6作为输入会发生什么? :-) – 6502 2012-03-10 17:43:01