Blogger Information
Blog 13
fans 1
comment 0
visits 8513
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
20190326-js基础2_作业
蛋炒饭的博客
Original
621 people have browsed it

实例  for循环打印九九乘法表

        for(i=1;i<=9;i++){
            for(j=1;j<=i;j++){
                document.write(j+'*'+i+'='+i*j+' ');
            }
            document.write('<br/>');
        }

运行实例 »

点击 "运行实例" 按钮查看在线实例

实例 用while循环打印出一个三角形

var i=1;
        while(i<20){
            var j=1;
            document.write("<div style='text-align:center'>");

            while(j<=i){
                document.write('*');
                j++;
            }

            document.write('</div>');
            i++;
        }

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post