2013年3月8日

摘要: (define s-rule (lambda (f a b n) (let [(h (/ (- b a) (* n 1.0))) (k 0)] (* (/ h 3) (sum (lambda (x) (let ([k (cond [(= x 0) 1] [(= x n) 1] [(odd? x) 4] [else ... 阅读全文

posted @ 2013-03-08 15:43 ASOCS 阅读(96) 评论(0) 推荐(0) 编辑

2013年3月6日

摘要: ;1.23(define smallest-divisor (lambda (n) (find-divisor n 2)))(define find-divisor (lambda (n test-divisor) (cond ((> (square test-divisor) n) n) ((divides? test-divisor n) test-divisor) (else (find-divisor n (next test-divisor))))))(define next (lambda (n) (if (= n 2) ... 阅读全文

posted @ 2013-03-06 22:43 ASOCS 阅读(119) 评论(0) 推荐(0) 编辑

2013年2月25日

摘要: !!! Your current profile is deprecated and not supported anymore.!!! Use eselect profile to update your profile.!!! Please upgrade to the following profile if possible: default/linux/x86/13.0You may use the following command to upgrade: eselect profile set default/linux/x86/13.0F GFW 阅读全文

posted @ 2013-02-25 02:18 ASOCS 阅读(157) 评论(0) 推荐(0) 编辑

2013年2月23日

摘要: (define double (lambda (x) (* 2 x)))(define halve (lambda (x) (/ x 2)))(define f-product (lambda (a b) (cond [(= a 0) 0] [(= a 1) b] [(even? a) (f-product (halve a) (double b))] [else (+ b (f-product (- a 1) b))])))(define f-fproduct (lambda (a b) ... 阅读全文

posted @ 2013-02-23 17:06 ASOCS 阅读(156) 评论(0) 推荐(0) 编辑

2013年2月21日

摘要: (define f-expt (lambda (b n) (define f-i (lambda (b n value cnt) (if (= n cnt) value (cond [(> (* 2 cnt) n) (f-i b n (* value b) (+ cnt 1))] [else (f-i b n (* value value) (* 2 cnt))])))) (f-i b... 阅读全文

posted @ 2013-02-21 23:24 ASOCS 阅读(127) 评论(0) 推荐(0) 编辑

摘要: 1 (define pascal2 (lambda (x y)3 (cond [(= y 1) 1]4 [(= x 1) 1]5 [(= x y) 1]6 [else (+ (pascal (- x 1) (- y 1))7 (pascal (- x 1) y))])))(define pascal (lambda (x y) (cond [(= y 1) 1] [(= x 1) 1] [(= x y) 1] [else (+ (pas... 阅读全文

posted @ 2013-02-21 13:47 ASOCS 阅读(101) 评论(0) 推荐(0) 编辑

2013年2月20日

摘要: (define f (lambda (x) (if (< x 3) x (+ (f (- x 1)) (* 2 (f (- x 2))) (* 3 (f (- x 3)))))));;--(define (f-tail n) (define f-i (lambda (x y z cnt) (if (= cnt 2) z (f-i y z (+ (* 3 x) (* 2 y) z) (- cnt 1))))) (f-... 阅读全文

posted @ 2013-02-20 17:32 ASOCS 阅读(145) 评论(0) 推荐(0) 编辑