Chat (Lingr.com)
Informaiton
Daily
Column
- MySQL日本語の旅(5/1)
- アクセス向上秘伝(5/9)
- 一風変ったHaskellλ門(6/13)
- SICP Answer Book (5/31) 問題3.26追加
Zope Solution
Extra
アーカイブ
OSS案内所
Site Info
関連リンク
##(link2sicp "book-Z-H-15.html#%_thm_2.19" "Exercise 2.19")
解答例
(define first-denomination car) (define except-first-denomination cdr) (define no-more? null?)
リスト coin-values の順は、cc の答に影響がない。このアルゴリズムでは硬貨の 区別が必要なだけで、順番には関係ない。実行例
gosh> (cc 100 us-coins) 292 gosh> (cc 100 uk-coins) 104561 gosh> (define us-coins2 (list 25 50 5 10 1)) us-coins2 gosh> (cc 100 us-coins2) 292
コード
##(sicp-answer-code "ex-2.19.scm")