数组练习题
2021-07-20 03:06
标签:alert 排序 mat 最大 java class push rand continue 数组练习题 标签:alert 排序 mat 最大 java class push rand continue 原文地址:https://www.cnblogs.com/cgj1994/p/9520196.html
var attr = [12, 34, 2, 5, 76];
var sum = 0;
for(var i = 0; i
var arr = [4, 0, 7, 9, 0, 0, 2, 6, 0, 3, 1, 0];
var a = [];
for(i = 0; i
var attr = [2, 34, 2, 5, 6, 9, 8, 6, 4, 34, 67, 6];
var b = [];
for(i = 0; i attr[k + 1]) {
var temp = attr[k];
attr[k] = attr[k + 1];
attr[k + 1] = temp;
}
}
}
if(attr[i] != attr[i + 1]) {
b.push(attr[i]);
}
}
alert(b);
var attr = [12, 34, 2, 5, 76];
var a = attr[0];
for(i = 0; i a) {
a = attr[i];
}
}
alert(a);
var a = new Array();
var b = [];
var bs = 0;
var i = -1;
while(true) {
i++;
a[i] = parseInt(Math.random() * 90 + 10);
if(b.indexOf(a[i]) == -1) {
b.push(a[i]);
bs++;
if(bs == 10) {
break;
}
}
}
for(j = 0; j b[k + 1]) {
var temp = b[k];
b[k] = b[k + 1];
b[k + 1] = temp;
}
}
}
document.write(b);
上一篇:程序自动分析(并查集+排序)
下一篇:python生成html表格