- #刷题
求助Scheme编程题

16109
求助一道Scheme编程题,地里有没有同学对Scheme比较熟悉呢?
只能用Scheme语言,或者如果用Scala也可以。小弟初学scheme,感觉很是不开窍啊,求点醒,求解题思路。
1st part:
input: an integer, n
output: a list of pair
for example:
input : n = 2
output: ((2 . 2) (2 . 0) (2 . 1) (1 . 1) (1 . 0) (0 . 0))
2nd part:
find all permutations of the list above
只能用Scheme语言,或者如果用Scala也可以。小弟初学scheme,感觉很是不开窍啊,求点醒,求解题思路。
1st part:
input: an integer, n
output: a list of pair
for example:
input : n = 2
output: ((2 . 2) (2 . 0) (2 . 1) (1 . 1) (1 . 0) (0 . 0))
2nd part:
find all permutations of the list above
9条回复
热度排序