我被要求帮助编写一个简单的数字生成脚本。脚本应该使用1到9之间的数字作为输入。然后,它应计算并输出输出数组中所有可能的3位数组合。
这是a link网站,它生成并输出完全符合我们脚本要求的数字。
感谢。
答案 0 :(得分:0)
现在使用以下代码:
for(var a = 0; a < 10; a++) {
for(var b = 0; b < 10; b++) {
for(var c = 0; c < 10; c++) {
var combination = a + '' + b + '' + c;
if(checkCode(parseInt(combination))) {
console.log("Password is: + combination)
}
}
}
}