【SICP练习】124 练习3.55
2015-03-28 22:11
169 查看
练习3-55
原文
Exercise 3.55. Define a procedure partial-sums that takes as argument a stream S and returns the stream whose elements are S0, S0 + S1, S0 + S1 + S2, …. For example, (partial-sums integers) should be the stream 1, 3, 6, 10, 15, ….代码
(define (partial-sums s) (cons-stream (stream-car s) (add-streams (stream-cdr s) (partial-sums s))))
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp
相关文章推荐
- 【SICP练习】124 练习3.55
- 【SICP练习】71 练习2.42
- 【SICP练习】108 练习3.21
- 【SICP练习】86 练习2.58
- 【SICP练习】145 练习4.1
- 【SICP练习】47 练习2.6
- 【SICP练习】74 练习2.45
- 【SICP练习】94 练习2.67
- 【SICP练习】57 练习2.27
- 【SICP练习】41 练习1.46
- 【SICP练习】8 练习1.12
- 【SICP练习】18 练习1.24
- 【SICP练习】45 练习2.4
- 【SICP练习】53 练习2.21
- 【SICP练习】69 练习2.40
- 【SICP练习】86 练习2.58
- 【SICP练习】102 练习2.79-2.80
- 【SICP练习】112 练习3.28
- 【SICP练习】117 练习3.44
- 【SICP练习】122 练习3.53