A number between 1 to a total of how many times the number appeared 1

//1-401有多少个一
function count(num){
var total = 0;
for (let i = 0; i <= num; i++){
total += String(i).split(1).length-1;
}
console.log(allc);
}
count(401);

Guess you like

Origin www.cnblogs.com/jia-bk-home/p/11419754.html