Dim a(1 To 10) As Integer
Private Sub Command1_Click()
Dim b As Integer
Randomize
a(1) = Int(Rnd() * 100)
b = Int(Rnd() * 100)
Text1.Text = a(1)
For i = 2 To 10
a(i) = a(i - 1) + b
Text1.Text = Text1.Text & " " & a(i)
Next i
End Sub
Private Sub Command2_Click()
Text3.Text = ""
For i = 1 To 10
If a(i) = Val(Text2.Text) Then Exit For
Next i
If i = 11 Then
MsgBox "在这10个元素的有序数列中没有要删除的数!"
Exit Sub
Else
For j = i To 9
a(j) = a(j + 1)
Next j
End If
For i = 1 To 9
Text3.Text = Text3.Text & a(i) & " "
Next i
End Sub
温馨提示:内容为网友见解,仅供参考