标签:
var s = ""; s += "<table>"; for (var i = 1; i < 10; i++) { s += "<tr>"; for (var j = 1; j <= i; j++) { s += "<td>" + i + "*" + j + "=" + i * j + "</td>"; } s += "</tr>"; } s += "</table>"; document.getElementById("dcon").innerHTML = s;
var iNum = [34, 19, 11, 109, 3, 56]; var temp=0; for (var i = 0; i <= iNum.length-2; i++) {
for (var j = i + 1; j <=iNum.length - 1; j++) { if (iNum[i] > iNum[j]) { temp = iNum[j]; iNum[j] = iNum[i]; iNum[i] = temp; } } } for (var a = 0; a < iNum.length; a++) { document.write(iNum[a] + "<br/>"); }
标签:
原文地址:http://www.cnblogs.com/16lily521/p/4877160.html