(define (sum-two-sqrt a b c)
(cond ((and (<= c a) (<= c b)) sqrt-sum(a b))
((and (<= a b) (<= a c)) sqrt-sum(b c))
((and (<= b a) (<= b c)) sqrt-sum(a c))
)
)
(define (sqrt-sum x y)
(+ (* x x) (*y y))
)
(define (<= x y)
(not (> x y))
(sum-two-sqrt 3 4 5)
这是我的代码
请帮我解决问题。:)
我今天才开始学习 Lisp。
之前学过一些C,但是这两种语言完全不同!
这就是问题定义一个以三个数字作为参数并返回两个较大数字的平方和的过程。
如果你有更好的算法
发表它!
谢谢 :)