JavaScript编写空心金字塔或等腰三角形
1、先写金字塔的头部var h=prompt("请输入三角形的高",5);for(var q=1;q<h;q++){颊俄岿髭document.write(" ");}document.write("*"+"<br>");

2、金字塔的中间内容for(var i=1;i<h-1;i++){酆璁冻嘌for(var n=1;n<h-i;荏鱿胫协n++){document.write(" ");}document.write("*");for(var j=1;j<=2*i-1;j++){document.write(" ");}document.write("*");document.write("<br>");}

3、金字塔底部for(var m=1;m<=2*h-1;m++){document.write("*");}
