") next %> 按F12键,预览得到输出结果,如下图: 下面用for循环来画一个金字塔,代码如下:
<%
for i=0 to 9
a=a & "口"
response.write(a)
response.write("
") next %>
按F12键,预览得到输出结果,如下图:
嵌套循环时,循环变量名不能同上一层循环的变量名相同。嵌套循环语句写法如下:
for 循环变量=初值to终点值
for 循环变量=初值to终点值
next
next
嵌套循环实例如下:
") next %>
<%
for i=0 to 9
for i2=0 to 9
response.write("口")
next
response.write("
") next %>
按F12键,预览得到输出结果,如下图:
") next %>