// 循环输出1~100之间的数字的和

var sum = 0; 
for(var i = 0; i <= 100; i++){

    sum += i; 

    // console.log(i);

};

console.log(sum);







// 循环输出1000以内的奇数 不能被2整除的是奇数


for(var i = 0;i <= 1000; i++){
    if(i % 2 != 0){
        console.log(i);
    };
    
};



//输出九九乘法表

for(var i = 1;i <= 9; i++){
    //console.log("i="+i);
    document.write("<br/>");
    for(var j = 1; j <= i;j++){
        sum = i*j;
        //console.log(i + "*" + j + "=" + sum);
        document.write(i + "*" + j + "=" + sum + "   ");
    };
};

2023-07-30T06:39:39.png

//输出九九乘法表

for(var i = 1;i <= 9; i++){
    //console.log("i="+i);
    document.write("<br/>");
    for(var j = 1; j <= i;j++){
        sum = i*j;
        //console.log(i + "*" + j + "=" + sum);
        document.write(j + "X" + i + "=" + sum + "   ");
    };
};

2023-07-30T06:43:09.png