当前位置:网站首页>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 …
边栏推荐
- Golang project dependency management tool go vendor, go Mod
- 第一次读 “Clean” 系列,并没有觉得这是一本多好的书
- JVM uses tools to analyze classic cases of OOM
- Error1822 and error1824 are displayed in the database
- Syntax 'trap'
- 请问通达信股票开户是安全的吗?
- 广发易淘金和同花顺哪个更好,更安全一些
- VGA display of de2-115 FPGA development board
- The best screenshot tool in the world, color absorption tool snipaste
- Report on Hezhou air32f103cbt6 development board
猜你喜欢

Variables, scopes, and variable promotion

程序员为什么要软一点?

Data acquisition system gateway acquisition plant efficiency

Page 112 machine learning - review of fundamentals of mathematics pptx

shell 变量 入门

Mise en place d'un Cluster kubernets avec plusieurs serveurs Cloud

算力&NFT交易平台F3.xyz旗下独家权益NFT项目Hash Eagle将盛大发行
![[open source Hongmeng system display] the rk3568 development board is equipped with openharmony 3.1 release](/img/c4/0bfb380d38b5205a02a10175ee6888.png)
[open source Hongmeng system display] the rk3568 development board is equipped with openharmony 3.1 release

用NumPy实现神经网络(Mysteries of Neural Networks Part III)

Reading the "clean" series for the first time, I didn't think it was a good book
随机推荐
腾讯云搭建Socks5多IP代理服务器实现游戏单窗口单IP完美搭建教程附带工具「建议收藏」
JS component
使用KVM虚拟化部署EVE-NG
Graph contractual learning with augmentations
How to solve SQL import
请问通达信股票开户是安全的吗?
启牛是正规的吗?股票开户安全吗?
通达信股票账户开户安全吗
哈希表、哈希冲突
打新债是不是不安全
DE2-115 FPGA开发板的VGA显示
对白:推荐系统快速入门路线及各知识点总结
英语中的九大词性与九大时态
untiy强制刷新UI
Page 112 machine learning - review of fundamentals of mathematics pptx
Cool assembly tutorial - concise x86 assembly language tutorial (1)
分类器与cross entropy loss函数
Garbage collection mechanism
What are the red lines of open source that should not be trodden on?
分享自己平时使用的socket多客户端通信的代码技术点和软件使用