<script>
//99乘法表
function test99(){
document.write("<table>");
for(var i=1;i<=9;i++){
document.write("<tr>");
for(var j=1;j<=i;j++){
document.write("<td style='border:1px solid black'>");
document.write(j+"*"+i+"="+i*j);
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");
//冒泡
function maopao(){
var array=[43,22,33,11,99,66,122,23];
for(var i=0;i<array.length-1;i++){
for(var j=0;j<array.length-1-i;j++){
if(array[j]>array[j+1]){
var temp=array[j];
array[j]=array[j+1];
array[j+1]=temp;
}
}
}
document.write(array);
//99乘法表
function test99(){
document.write("<table>");
for(var i=1;i<=9;i++){
document.write("<tr>");
for(var j=1;j<=i;j++){
document.write("<td style='border:1px solid black'>");
document.write(j+"*"+i+"="+i*j);
document.write("</td>");
}
document.write("</tr>");
}
document.write("</table>");
}
//冒泡
function maopao(){
var array=[43,22,33,11,99,66,122,23];
for(var i=0;i<array.length-1;i++){
for(var j=0;j<array.length-1-i;j++){
if(array[j]>array[j+1]){
var temp=array[j];
array[j]=array[j+1];
array[j+1]=temp;
}
}
}
document.write(array);
}
11,22,23,33,43,66,99,122