新建一个工程,在窗体上添加一个按钮,输入以下代码,运行点击按钮就可
Private a1&(1 To 10), a2&(1 To 10)
Private Sub Command1_Click()
Dim b1&, b2&
For b1 = 1 To 10
a1(b1) = Int(Rnd() * 100)
Print a1(b1);
Next
Print
For b1 = 10 To 1 Step -1
Print a1(b1);
Next
Print
Print "下标奇数:";
For b1 = 1 To 10 Step 2
Print a1(b1);
Next
Print
Print "下标偶数:";
For b1 = 2 To 10 Step 2
Print a1(b1);
Next
End Sub