数组问题?
option base 1
private sub command1_click()
k = 5
for i = 1 to 10 a(i)=i
next i
for i = 1 to 3 p(i)=a(i*i)
next i
for i = 1 to 3 k = k +p(i)*2
next i
a(1)=1.........a(10)=10
p(1)=a(1)=1
p(2)=a(2*2)=a(4)=4
p(3)=a(3*3)=a(9)=9
关键:for i = 1 to 3 k = k +p(i)*2 next i
i=1k=k+2p(1)
i=2 k=k+2P(1)+2p(2)
i=3 k=k+2p(1)+2p(2)+2p(3)=5+2(1+4+9)=33
应该是这样的