当前位置:网站首页>Output 0 ~ n digits and output multiple times
Output 0 ~ n digits and output multiple times
2022-06-25 14:18:00 【jason_ renyu】
Output 0~n And output it many times , This method is similar to the output 010101010101,012012012012012,012301230123, Such a sequence of numbers ;
In this way, the output sequence can make an array output several times in sequence , It is not clear what this method is called , Or it is not an algorithm , Put it here first. If you know, please leave a message below , thank you !
javascript The way
const sFun = (value, length, vflag) => {
let n = value;
// Judge whether the critical value is reached
// Default as value = 6, The returned number is 0-5 Six bit loop
if (vflag) {
n = value + 1;
}
let l = length + 1;
let page = 1;
let arr = [];
for (let i = 1; i < l; i++) {
let resultN = n + (i - page * n - 1);
arr.push(resultN)
if (i % n == 0) {
page++
}
}
return arr;
}
console.log(sFun(6, 100, true))
Java The method is followed by …
边栏推荐
- Windows下MySQL的安装和删除
- Shell string variable
- 哈希錶、哈希沖突
- 数据采集系统网关采集工厂效率
- [world history] Episode II: Dawn of civilization
- Is it safe to open an account with tongdaxin stock?
- Nine parts of speech and nine tenses in English
- None of the MLIR Optimization Passes are enabled (registered 2)解决办法
- How to choose a technology stack for web applications in 2022
- 多台云服务器的 Kubernetes 集群搭建
猜你喜欢

Application of tactile intelligent sharing-rk3568 in financial self-service terminal

深入理解深度神经网络背后的数学(Mysteries of Neural Networks Part I)

完整详细的汇编实验报告

Where can the brightness of win7 display screen be adjusted

Pourquoi les programmeurs devraient - ils être plus doux?

多台云服务器的 Kubernetes 集群搭建

Settings the PC must be turned on

How does hash eagle, the founder of equity NFT, redefine NFT and use equity to enable long-term value?

当了六年程序员第一次搞懂微服务架构的数据一致性,真不容易

Getting started with numpy Library
随机推荐
shell 运算符
一次性总结:64个数据分析常用术语!
112页机器学习-数学基础回顾.pptx
哈希錶、哈希沖突
Graph contractual learning with augmentations
Asp. Net webform exporting excel using npoi
Today in history: Netease was founded; The first consumer electronics exhibition was held; The first webcast in the world
None of the MLIR Optimization Passes are enabled (registered 2)解决办法
Encapsulating functions and event handling
[world history] Episode 1: people in the Stone Age
Partager les points techniques de code et l'utilisation de logiciels pour la communication Multi - clients socket que vous utilisez habituellement
国信证券股票开户是安全的吗?
算力&NFT交易平台F3.xyz旗下独家权益NFT项目Hash Eagle将盛大发行
Suanli & NFT trading platform f3 The exclusive NFT project of XYZ, hash eagle, will be grandly launched
第一次读 “Clean” 系列,并没有觉得这是一本多好的书
广发易淘金和同花顺哪个更好,更安全一些
Realization of neural networks with numpy
多臺雲服務器的 Kubernetes 集群搭建
Stream竟然还有应用进阶学习?作为程序员的你知道吗
turtlebot+lms111+gmapping实践