日期:2014-05-16 浏览次数:20366 次
arr = new Array('12','12','12','12','1','1','1','1','1','1');
range(arr);
function range(arr,k=0,str=''){
var i=0;
var v=k+1;
var length = arr[k].length;
while(i<length){
if(k!=9){
range(arr,v,str+arr[k][i]);
}else{
alert(str+arr[k][i]);
}
i++;
}
return false;
}
arr = new Array('12','12','12','12','1','1','1','1','1','1');
range(arr,0,"");
function range(arr,k,str){
var i=0;
var v=k+1;
var length = arr[k].length;
while(i<length){
var arr2 = arr[k].split("");
if(k!=9){
range(arr,v,str+arr2[i]);
}else{
alert(str+arr2[i]);
}
i++;
}
return false;
}