第1个回答 2020-07-22
Dim a() As Integer
Private Sub Command1_Click()
Cls
ReDim a(9)
Dim i As Integer
For i = 0 To 9
a(i) = 10 + Int(Rnd * 90)
Print a(i);
Next
Print
Print
End Sub
Private Sub Command2_Click()
Dim i As Integer, f As Boolean
For i = 0 To UBound(a)
If a(i) = Val(Text1.Text) Then
f = True
Exit For
End If
Next
Dim j As Integer
For j = i To UBound(a) - 1
a(j) = a(j + 1)
Next
If f Then
ReDim Preserve a(UBound(a) - 1)
End If
For i = 0 To UBound(a)
Print a(i);
Next
Print
Print
End Sub