编程实现以下功能:单击生成数组按钮,产生10个随机两位正整数,存放在数组a中并显示;单击删除数组按钮,从键盘输入要删除的数组元素的下标,将该元素中的数据删除,后面元素中的数据依次前移,并显示删除后剩余的数据
Dim a(10) As Integer
Private Sub Command1_Click()
Randomize
Print "原来的数组:"
For i = 1 To 10
a(i) = Rnd * 90 + 10
Print a(i);
Next i
End Sub
Private Sub Command2_Click()
k = CInt(InputBox("请输入要删除的元素序号:"))
For i = k To 9
a(k) = a(k + 1)
Next i
Print: Print "删除原第"; k; "个元素以后的数组:"
For i = 1 To 9
Print a(i);
Next i
End Sub