• 九九乘法表和空直角


    <!DOCTYPE html>
    <html>

        <head>
            <meta charset="UTF-8">
            <title></title>
        </head>

        <body>
        </body>

    </html>
    <script>
        //乘法表
        for(var i = 1; i <= 9; i++) {
            for(var j = 1; j <= i; j++) {
                document.write(j + "*" + i + "=" + j * i + ",");
            }
            document.write("<br>")
        }
        document.write("<br>")
        document.write("<br>")

        //  空直角
        //  *
        //  **
        //  * *
        //  * *
        //  * *
        //  *****
        for(var i = 1; i <= 6; i++) {
            for(var j = 1; j <= 1; j++) {
                document.write("*");
            }
            for(var k = 1; k <= i - 2; k++) {
                if(i == 6) {
                    document.write("*");
                } else {
                    document.write("&ensp;");
                }

            }
            if(i > 1 && i <= 6) {
                for(var j = 1; j <= 1; j++) {
                    document.write("*");
                }
            }
            document.write("<br>");
        }
    </script>
  • 相关阅读:
    java序列化和反序列化使用总结
    什么是N+1查询?
    Oracle insert /*+ APPEND */原理解析
    Oracle redo与undo
    MongoDB(三)-- 执行JS、界面工具
    几种Bean的复制方法性能比较
    Kafka(三)-- Kafka主要参数
    Kafka(二)-- 安装配置
    Kafka(一)-- 初体验
    Nginx(十二)-- Nginx+keepalived实现高可用
  • 原文地址:https://www.cnblogs.com/tis100204/p/10319183.html
Copyright © 2020-2023  润新知