当前位置:网站首页>JS generate random numbers
JS generate random numbers
2022-07-02 03:24:00 【onYang】
const getNum = (andNum, Num) => {
//andNum Sum of random numbers ,Num Number of random numbers
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)边栏推荐
- Eight steps of agile development process
- Go execute shell command
- Learn PWN from CTF wiki - ret2shellcode
- West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
- 表单自定义校验规则
- Merge interval, linked list, array
- The capacity is upgraded again, and the new 256gb large capacity specification of Lexar rexa 2000x memory card is added
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- Global and Chinese markets for hand hygiene monitoring systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of X-ray detectors 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Framing in data transmission

Download and use of the super perfect screenshot tool snipaste
![[golang] leetcode intermediate bracket generation & Full Permutation](/img/93/ca38d97c721ccba2505052ef917788.jpg)
[golang] leetcode intermediate bracket generation & Full Permutation

Render header usage of El table

Form custom verification rules

ZABBIX API creates hosts in batches according to the host information in Excel files

数据传输中的成帧

浅谈线程池相关配置

Eight steps of agile development process

Review materials of project management PMP high frequency examination sites (8-1)
随机推荐
Grpc快速实践
Load different fonts in QML
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
JS introduction < 1 >
[database]jdbc
aaaaaaaaaaaaa
Intersection vengraph
Uniapp uses canvas to generate posters and save them locally
只需简单几步 - 开始玩耍微信小程序
Mathematical calculation in real mode addressing
命名块 verilog
aaaaaaaaaaaaa
[数据库]JDBC
Force deduction daily question 540 A single element in an ordered array
QT environment generates dump to solve abnormal crash
Docker installs canal and MySQL for simple testing and implementation of redis and MySQL cache consistency
Form custom verification rules
Verilog 过程连续赋值
MSI announced that its motherboard products will cancel all paper accessories
Delphi xe10.4 installing alphacontrols15.12