1. DashBoard...

# 练习2.73-练习2.74

1.练习2.73 a 没有必要 b (define (insert-sum-proc) (define (deriv-sum exp var) (make-sum (deriv (car exp) var) (deriv (cadr exp) var))) (put 'deriv '+ deriv-sum) 'done) (define (...

# 练习2.53-练习2.56

1.练习2.53 '(a b c) '((george)) '((y1 y2)) '(y1 y2) #f #f '(red shoes blue socks) 2.练习2.54 (define (equal? s1 s2) (cond ((and (null? s1) (null? s2)) true) ((or (null? s1) (null? s...

# 练习2.48-练习2.51

1.练习2.48 (define (make-segment start end) (cons start end)) (define (start-segment seg) (car seg)) (define (end-segment seg) (cdr seg)) 2.练习2.49 (require (planet "sicp.ss" ("soegaard" "sicp...

# 练习1.23-练习1.30

1.练习1.23 改后的代码如下： (define (find-divisor-better n a) (cond ((> (square a) n) n) ((divides?-better n a) a) (else (find-divisor-better n (next-2 a))))) (define (next-2 n) (if (= 2 n) (+ 1...

# 练习2.21-练习2.35

1.练习2.21 (define (square-list items) (if (null? items) '() (cons (square (car items)) (square-list (cdr items))))) (define (square-list items) (map (lambda (x) (square x)) items)) 2...

# 练习2.41-练习2.47

1.练习2.41 (define (seprate-except x except) (filter (lambda (couple) (let ((first (car couple)) (second (cadr couple))) (and (not (= first except))...

# 练习2.11-练习2.20

1.练习2.11 (define (mul-interval x y) (let ((x1 (lower-bound x)) (x2 (upper-bound x)) (y1 (lower-bound y)) (y2 (upper-bound y))) (let ((zzx (and (>= x1 0) (>= x2 0))) (zzy (and (>= y1 0) (>...

# 练习2.2-练习2.10

1.练习2.2 (define (make-segment start end) (cons start end)) (define (start-segment seg) (car seg)) (define (end-segment seg) (cdr seg)) (define (make-point x y) (cons x y)) (define (x-poin...

# 练习2.1

1.练习2.1 (define (check-pos-neg a b) (or (and (not ( 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...

# 练习1.40-练习1.46

1.练习1.40 (define (cubic a b c) (define (cube x) (* x x x)) (lambda (x) (+ (cube x) (* a (square x)) (* b x) c))) (define (newtons-method g guess) (fixed-point (ne...

# 练习1.35-练习1-38

1.练习1.35 (fixed-point (lambda (x) (+ 1 (/ 1 x))) 1.0) 2.练习1.36 不用平均阻尼方式： (fixed-point-display (lambda (x) (/ (log 1000) (log x))) 2.0) 结果为： 2. 9.965784284662087 3.004472209841214 6.2791957575071...

# 练习1.23-练习1.30

1.练习1.23改后的代码如下： (define (find-divisor-better n a) (cond ((> (square a) n) n) ((divides?-better n a) a) (else (find-divisor-better n (next-2 a))))) (define (next-2 n) (if (= 2 n) (+...

# 练习1.18-练习1.22

1.练习1.18 (define (*-iter a b n) (cond ((= n 0) a) ((even? n) (*-iter a (double b) (halve n))) (else (*-iter (+ a b) b (- n 1))))) (define (* b n) (*-iter 0 b n)) Lisp真是强大啊，连 *-iter这种函数名也可以使用！...

# 练习1.10-练习1.17

1.练习1.10 表达式的求值就不说了。 (define (f n) (A 0 n)) -------2n (define (g n) (A 1 n))-------2的n次方 (define (h n) (A 2 n))-------n个2的次方，例如：(h 4)表示为2的2次方的2次方的2次方 2.练习1.11 递归计算过程： (define (f1 n) (if (< n...

# 练习1.1－练习1.9

1. 练习1.1 这个题没有什么好说的了，只要把代码敲出来，运行一遍就可以了。 2. 练习1.2 这个题应该不算难吧，没有看过别人的答案，我把我的贴出来吧。 (/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7))) 3.练习1.3 我的方法是求出3个数的和，再将减去最小的数，算不上最好的方法吧，马马虎虎。 (def...

# Emacs安装和设置tabbar

199条 共10页首页 上一页 1 2 3 4 5 ... 下一页 尾页
个人资料
• 访问：105129次
• 积分：2767
• 等级：
• 排名：第14260名
• 原创：178篇
• 转载：21篇
• 译文：0篇
• 评论：9条
文章分类
阅读排行
评论排行
最新评论