两个循环就能解决的东西,非要搞三个循环,看着不累吗?var a=0;for(var i=1;i<=5;i++){for(var g=1;g<=i+a;g++){document.write('*');}a++;document.write('');}