您的位置:首页 > Web前端

P24 (*) Lotto: Draw N different random numbers from the set 1..M.

2016-01-23 19:36 197 查看

问题描述

The selected items shall be returned in a list.

sash> (lotto-select 6 49)
-> (23 1 17 33 21 37)


Hint: Combine the solutions of problems P22 and P23.

解法

(define lotto-select
(lambda (N M)
(rnd-select (range 1 M) N)))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  scheme lisp