当前位置:网站首页>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)边栏推荐
- Verilog 线型wire 种类
- ThreadLocal详解
- Halcon image rectification
- Render header usage of El table
- MySQL advanced (Advanced) SQL statement (II)
- Force deduction daily question 540 A single element in an ordered array
- 焱融看 | 混合雲時代下,如何制定多雲策略
- Global and Chinese market of bone adhesives 2022-2028: Research Report on technology, participants, trends, market size and share
- What is the binding path of SAP ui5
- Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

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

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

Named block Verilog
![[HCIA continuous update] overview of dynamic routing protocol](/img/03/83c883afb63b7c63f6879b5513bac3.jpg)
[HCIA continuous update] overview of dynamic routing protocol

Discrimination between sap Hana, s/4hana and SAP BTP

只需简单几步 - 开始玩耍微信小程序

ThreadLocal详解
On redis (II) -- cluster version

Cache processing scheme in high concurrency scenario

Mmsegmentation series training and reasoning their own data set (3)
随机推荐
Generate random numbers that obey normal distribution
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
JIT deep analysis
Qualcomm platform WiFi -- Native crash caused by WiFi
Global and Chinese market of autotransfusion bags 2022-2028: Research Report on technology, participants, trends, market size and share
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
32, 64, 128 bit system
Go execute shell command
V-model of custom component
Which of PMP and software has the highest gold content?
How to establish its own NFT market platform in 2022
Delphi xe10.4 installing alphacontrols15.12
Start a business
知物由学 | 自监督学习助力内容风控效果提升
Cache processing scheme in high concurrency scenario
Large screen visualization from bronze to the advanced king, you only need a "component reuse"!
aaaaaaaaaaaaa
PMP personal sprint preparation experience
4. Find the median of two positive arrays
Detailed explanation of the difference between Verilog process assignment