当前位置:网站首页>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)边栏推荐
- aaaaaaaaaaaaa
- JDBC details
- [golang] leetcode intermediate bracket generation & Full Permutation
- Qualcomm platform wifi-- WPA_ supplicant issue
- C shallow copy and deep copy
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- 图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
- ORA-01547、ORA-01194、ORA-01110
- Intersection of Venn graph
- Work hard all day long and be alert at sunset
猜你喜欢
![寻找重复数[抽象二分/快慢指针/二进制枚举]](/img/9b/3c001c3b86ca3f8622daa7f7687cdb.png)
寻找重复数[抽象二分/快慢指针/二进制枚举]

高并发场景下缓存处理方案

Verilog 过程连续赋值

汇率的查询接口

GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面

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

Verilog timing control

MySQL connection query and subquery

West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials

Form custom verification rules
随机推荐
Named block Verilog
MSI announced that its motherboard products will cancel all paper accessories
/silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult
Xiaomi, a young engineer, was just going to make soy sauce
Global and Chinese market of bone adhesives 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL connection query and subquery
数据传输中的成帧
Go execute shell command
One of the future trends of SAP ui5: embrace typescript
Discussion on related configuration of thread pool
流线线使用阻塞还是非阻塞
verilog REG 寄存器、向量、整数、实数、时间寄存器
Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
Baohong industry | four basic knowledge necessary for personal finance
[HCIA continuous update] overview of dynamic routing protocol
Qualcomm platform wifi-- WPA_ supplicant issue
Detailed explanation of the difference between Verilog process assignment
C#联合halcon脱离halcon环境以及各种报错解决经历
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination