VB输出结果是多少
PrivateSubForm_Click()Dimia,i%,n%,t%n=InputBox("enterN=?")ia=Array(1,2,3,4,5,6,7,8,9,...
Private Sub Form_Click()
Dim ia, i%, n%, t%
n = InputBox("enter N=?")
ia = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
For i = 1 To n \ 2
t = ia(i): ia(i) = ia(n - i +1): ia(n - i + 1) = t
Next i
For i = 0 To UBound(ia)
Print ia(i);
Next i
End Sub
程序运行后,单击窗体,输入数据为6,则输出结果为 展开
Dim ia, i%, n%, t%
n = InputBox("enter N=?")
ia = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
For i = 1 To n \ 2
t = ia(i): ia(i) = ia(n - i +1): ia(n - i + 1) = t
Next i
For i = 0 To UBound(ia)
Print ia(i);
Next i
End Sub
程序运行后,单击窗体,输入数据为6,则输出结果为 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询