用for循环输出菱形

输出菱形

<center>
<script type="text/javascript">
       for(var i=1;i<=11;i+++){
          for(var j=1;j<=2*i-1;j++){
          document.write("*")
          }document.write("<>br")
       }
       for(var a=11;a>=1;a--){
          for(var b=1;b<=2*a-1;b++){
          document.write("*")
          }document.write("<br>")
      }
</script>

</cenetr>

猜你喜欢

转载自blog.csdn.net/liuhebahuang/article/details/107849123
今日推荐