您的位置:首页 > 其它

求0至大数之间的随机数

2016-06-02 10:36 477 查看
题目:给定一个String类型的大数(非负整数),不能直接转化为Integer,类似如下要求

The numbers can be arbitrarily large and are non-negative.
Converting the input string to integer is NOT allowed.

You should NOT use internal library such as BigInteger.
求0到该数的随机数,例如:给定的数是999,保证0至999中间任意一个数被取到的概率都是1/999
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  算法