【求助】看看魔术师这题怎么解。
过年期间,已经完成了所有作业的小吴同学和朋友们玩起了卡牌魔术:有13张扑克牌(A 2 3 4 5 6 7 8 9 10 J Q K),预先排好,牌面朝下,从最上面开始,将第一张牌翻过来看正好是A;继续数手里的余牌,第二次数1,2将第一张牌放到这叠牌的下面,将第二张翻开,正好是黑桃2,也把它放在桌上;第三次数1,2,3,前面两张牌放到这叠牌的下面,取出第三张,正好是黑桃3,这样依次将13张牌翻出,正好是(A 2 3 4 5 6 7 8 9 10 J Q K),求:牌的原始顺序应该怎样排呢?为解决这个问题,小吴编写了一个VB程序运行如下:为实现上述功能,请在划线处填入合适的代码:
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer
Dim t As Integer, temp As Integer
Dim a(1 To 13) As Integer
Dim jg As String
Const kp = "JQK"
a(13) = 1
For i = 12 To 1 Step -1
_____①____
For j = i + 1 To 13
a(j) = a(j) + 1
Next j
For j = 1 To i - 1
_____②_____
For k = 13 To i + 1 Step -1
t = k + 1
If t > 13 Then t = i
a(t) = a(k)
Next k
_______③_____
Next j
Next i
List1.AddItem "牌堆的原始顺序为:"
For i = 1 To 13
If a(i) = 1 Then
jg = "A"
ElseIf a(i) > 10 Then
jg = _____④_________
Else
jg = CStr(a(i))
End If
List1.AddItem jg
Next i
End Sub