<%
dim a(6)
for i=0 to 6
a(i)=i+1
next
for i=0 to 6
count=count+a(i)+1
next
response.write (count)
为什么输出的结果会是35.谁能帮我解释一下.谢谢
<%
dim a(6)
for i=0 to 6
a(i)=i+1
next
for i=0 to 6
count=count+a(i)+1
next
response.write (count)
为什么输出的结果会是35.谁能帮我解释一下.谢谢
dim a(6) 定义 a(0)~a(6) 7个元素的数组
for i=0 to 6
a(i)=i+1 从a(0)开始赋值,a(0)~a(6) 对应 1~7
next
for i=0 to 6
count=count+a(i)+1 '这个地方是连加,相当于是从2一直加到8,count的结果就为35
next
response.write (count)
response.write (count)
next
dim a(6) for i=0 to 6 a(i)=i+1 next for i=0 to 6 count=count+a(i)+1
response.write (count)
next
response.write (count)
这样看就明白了呀