js中的运算总结(未完待续

【74由几个1几个5几个10几个20组成】

 var num = 74;
for(one = 0; one <= num; one++){
for(five = 0; five <= num/5 ; five++){
for(ten = 0; ten <= num/5 ; ten++){
for(twenty = 0; twenty <= num/20; twenty++){
if(one + five*5 + ten*10 + twenty*20 == num){
console.log(one + "个1," + five + "个5," + ten +"个10," + twenty + "个20组成。");
}
}
}
}
}
上一篇:Java_数组, 懒得整理了 ---------------------> 未完, 待续


下一篇:基于Redis实现分布式锁(1)