下面的程序代码实现将一个一维数组中元素向右循环移动,移位次数由文本框Text1输入。例如数组各元
Private Sub MoveRight (x() As Integer)
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = UBound (x)
j = x(i)
For k = i To【 】Step -1
【 】
Next k
x(LBeund(x)) = j
End Sub
Private Sub Command1_click()
Dim a(10) As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
For i = 0 To 10
a(i) = i
Next i
j = Val(TextText)
k=0
Do
k=k+1
Call MoveRight(A)
Loop Until k = j
For i = 0 To 10
Print a(i);
Next i
End Sub