*
**
***
****
*****
*****
****
***
**
*
输出如上图形,最好用vb.net,c sharp也行

解决方案 »

  1.   

    我自己写了一种,感觉不好
    <%
    dim temp as string=""
    dim i,j as integer
    for j=1 to 5 step 1
    for i=1 to j step 1
    temp+="*"
    next i
    response.write (temp & "<br>")
    temp=""
    next j
    for j=5 to 1 step -1
    for i=j to 1 step -1
    temp+="*"
    next i
    response.write (temp & "<br>")
    temp=""
    next j
    %>
      

  2.   

    你自己写得不挺好的么。非得用嵌套loop?你这个的order是n,嵌套就得是n^2了。最简单的
    response.write("*<br>**<br>***<br>****<br>*****<br>*****<br>****<br>***<br>**<br>*<br>");
      

  3.   

    <%
    dim temp as string=""
    dim i,j as integer
    for j=1 to 5 step 1
            
    response.write (temp.PadLeft(j,'*') & "<br>")

    next j
    for j=5 to 1 step -1
    response.write (temp.PadLeft(j,'*') & "<br>")
    next j
    %>
      

  4.   

    padleft是个不错的办法啊哦。刚才没想到。