一道VB题目求解答
PrivateSubCommand1_Click()Dima(5)Fori=0To4a(i)=i+1t=i+1Ift=3ThenPrinta(i)a(t-1)=a(i-2...
Private Sub Command1_Click()
Dim a(5)
For i = 0 To 4
a(i) = i + 1
t = i + 1
If t = 3 Then
Print a(i)
a(t - 1) = a(i - 2)
Else
a(t) = a(i)
End If
If i = 3 Then a(i + 1) = a(t - 4)
a(4) = 1
Print a(i)
Next i
End Sub
问单击按钮后的结果,答案是1 2 3 1 4 1 ,可我不知道是怎么做出来的,有哪位高人能教教我,要详细点
能推前3个答案让我看看吗? 展开
Dim a(5)
For i = 0 To 4
a(i) = i + 1
t = i + 1
If t = 3 Then
Print a(i)
a(t - 1) = a(i - 2)
Else
a(t) = a(i)
End If
If i = 3 Then a(i + 1) = a(t - 4)
a(4) = 1
Print a(i)
Next i
End Sub
问单击按钮后的结果,答案是1 2 3 1 4 1 ,可我不知道是怎么做出来的,有哪位高人能教教我,要详细点
能推前3个答案让我看看吗? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询