练习2.1 发表于 2014-01-14 | | ❤ 版权声明:本文为博主原创文章,转载请注明出处,谢谢! 版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2014/01/14/2014-01-14-练习2.1/访问原文「练习2.1」 1.练习2.1 123456789101112(define (check-pos-neg a b) (or (and (not (< a 0)) (> b 0)) (and (not (> a 0)) (< b 0))))(define (make-rat n d) (let ((g (gcd (abs n) (abs d))) (posi (check-pos-neg n d))) (cons (/ (if posi (abs n) (- (abs n))) g) (/ (abs d) g)))) 欢迎加入微信公众号 赏 微信打赏 支付宝打赏