zoukankan      html  css  js  c++  java
  • JavaScript之菱形打印

    很高兴来到博客园!迈入这座知识的殿堂,实是幸运。这是我的第一篇博客,开启丰富有趣的学习之旅,同时,我希望和大家一起学习一起进步,Let‘s go!

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>打印菱形</title>
    </head>
    <body>
    <center>
    <script language="javascript">
    var k=prompt("请输入打印行数:","");
    for(var i=1;i<=k;i++){
    for(var j=0;j<i;j++){
        document.write("*   ");
        }
        document.write("<br/>");
     
    }
    for(var i=k-1;i>0;i--){
    for(var j=0;j<i;j++){
        document.write("*   ");
        }
        document.write("<br/>");
     
    }
    </script>
    </center>
    </body>
    </html>

    If reference to indicate the source:caiduping

    不努力,还要青春干什么?
  • 相关阅读:
    从视频中每隔固定帧进行提取图片
    np.concatenate的超简单理解
    python-OOP(面向对象)
    机器学习中的ground truth
    深度学习网络中backbone是什么意思?
    缓存
    Linux基础命令
    openoffice相关命令
    HTTP协议
    Solr基础
  • 原文地址:https://www.cnblogs.com/caidupingblogs/p/4925322.html
Copyright © 2011-2022 走看看