2015/09/08 21:46

# 练习3-72

## 原文

Exercise 3.72. In a similar way to exercise 3.71 generate a stream of all numbers that can be written as the sum of two squares in three different ways (showing how they can be so written).

## 代码

 (define (square x) (* x x))
(define (sum-square x) (+ (square (car x)) (square (cadr x))))
(define square-numbers (squaresn (weighted-pairs integers integers sum-square))) 

http://blog.csdn.net/nomasp

0
0 收藏

0 评论
0 收藏
0