提示是定義一個返回三個數字中兩個最大值的平方和的過程。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