dima(5)fori=1to5a(i)=inexta(1)=tfori=2to5a(i-1)=a(i)nexta(i-1)=tfori=1to5printa(i)next结果是2-3-4-5-1为什么最后一个是1呢.
for i=1 to 5
a(i)=i
next
a(1)=t
for i =2 to 5
a(i-1)=a(i)
next
a(i-1)=t
for i=1 to 5
print a(i)
next
结果是2-3-4-5-1为什么最后一个是1呢.
我理解题目的用意是:将1,2,3,4,5 数组的第1个元数移到最后,重新显示.
我修改的代码如下:
Private Sub Command1_Click()
Dim a(5)
For i = 1 To 5
a(i) = i
Next
t = a(1)
For i = 2 To 5
a(i - 1) = a(i)
Next
a(5) = t
For i = 1 To 5
Print a(i)
Next
End Sub
运行结果如下图所示:
-- Haven”t you forgetten ( --( Oh,I forget my bag 2020-05-14 …
I have no pens ___ no pencils.A and B not C or D 2020-05-16 …
I come here .I left shool in 2005.(用现在完成时改写) I __ 2020-05-16 …
( ) 2 -I'd like to buy that coat.-I'm sorry. ___. 2020-05-16 …
before i started high schol i used to spend a lot 2020-05-16 …
凭什么为什么说European是辅音音素开头?我记得五个元音a.e.i.o.u...凭什么为什么说 2020-06-20 …
在英语单词中,e什么时候发/i/?什么时候发/e/?i什么时候发/ai/,什么时候发/i/? 2020-07-14 …
atlunch和forlunch,有什么不一样?那个对?I'm(s)I'mlateagain.填什 2020-07-17 …
well,I'llhaveteabymyself中I'll整个单词是什么为什么要有前面I后面还有m 2020-07-25 …
c自加自减问题我晕了#includemain(){inti,x,y;i=2;x=(++i)+(i++ 2020-11-01 …