代码:
<body>
<%-- 定义行和列 --%>
<%! int row ,col ,space; %>
<%-- 进行绘图--%>
<%
for (row = 1; row<= 18; row ++)
{
if(row%2 ==0)
out.println("<br>");
else
{
for(space = 0; space < row/2; space++)
out.println(" ");
for (col = 18-row; col >=0; col--)
out.println("*");
out.println("<br>");
}
%> </body>