vb怎么将一个一维数组不断右循环移动?每次移动一位。
1个回答
展开全部
Private Sub Command1_Click()
Dim a(7) As Integer, i As Integer, j As Integer, t As Integer
For i = 1 To 7
a(i) = i
Print a(i);
Next i
Print
For i = 1 To 7
t = a(7)
For j = 7 To 2 Step -1
a(j) = a(j - 1)
Next j
a(1) = t
For j = 1 To 7
Print a(j);
Next j
Print
Next i
End Sub
Dim a(7) As Integer, i As Integer, j As Integer, t As Integer
For i = 1 To 7
a(i) = i
Print a(i);
Next i
For i = 1 To 7
t = a(7)
For j = 7 To 2 Step -1
a(j) = a(j - 1)
Next j
a(1) = t
For j = 1 To 7
Print a(j);
Next j
Next i
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询