当前位置:网站首页>js生成随机数
js生成随机数
2022-07-02 03:21:00 【onYang】
const getNum = (andNum, Num) => {
//andNum随机数之和,Num随机数个数
var randomNum = new Array()
let sum = 0
for (var i=0;i<Num-1;i++)
{
x = Math.floor(Math.random() * (andNum - sum))
randomNum[i] = x
sum += x
}
randomNum[Num-1] = andNum - sum
return randomNum
}
getNum(50,6)边栏推荐
- KL divergence is a valuable article
- 汇率的查询接口
- Form custom verification rules
- Possible causes of runtime error
- Pointer array & array pointer
- Go执行shell命令
- GSE104154_ scRNA-seq_ fibrotic MC_ bleomycin/normalized AM3
- GB/T-2423. XX environmental test documents, including the latest documents
- Verilog parallel block implementation
- Rotating frame target detection mmrotate v0.3.1 learning model
猜你喜欢

Delphi xe10.4 installing alphacontrols15.12

C shallow copy and deep copy

Verilog timing control
![Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]](/img/9b/3c001c3b86ca3f8622daa7f7687cdb.png)
Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]
![寻找重复数[抽象二分/快慢指针/二进制枚举]](/img/9b/3c001c3b86ca3f8622daa7f7687cdb.png)
寻找重复数[抽象二分/快慢指针/二进制枚举]

Redis cluster

小米青年工程师,本来只是去打个酱油

Learn PWN from CTF wiki - ret2shellcode

Baohong industry | what misunderstandings should we pay attention to when diversifying investment

Halcon image rectification
随机推荐
Render header usage of El table
What is hybrid web containers for SAP ui5
Halcon image rectification
Discussion on related configuration of thread pool
创业了...
ThreadLocal详解
QT environment generates dump to solve abnormal crash
V-model of custom component
KL divergence is a valuable article
Use usedeferredvalue for asynchronous rendering
Generate random numbers that obey normal distribution
[C Advanced] brother Peng takes you to play with strings and memory functions
【JVM】创建对象的流程详解
Verilog 避免 Latch
流线线使用阻塞还是非阻塞
C#聯合halcon脫離halcon環境以及各種報錯解决經曆
Use blocking or non blocking for streamline
Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
Cache processing scheme in high concurrency scenario