posted @ 2013-03-08 15:43 ASOCS 阅读(96) 评论(0) 推荐(0) 编辑
摘要:
(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 ... 阅读全文
摘要:
;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) 编辑
摘要:
!!! 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) 编辑
摘要:
(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) 编辑
摘要:
(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) 编辑