Const n = 20
Dim i As Integer
Dim a(1 To n) As String
Private Sub Form_Load()
Randomize
For i = 1 To n
a(i) =
Text1.Text = Text1.Text + " " + a(i)
Next i
End Sub
Private Sub Command1_Click()
Dim k As Integer, count As Integer
Dim b(0 To 7) As Integer
k = Val(Text2.Text)
For i = 1 To n
Next i
i = 1
Do While i < 7 And b(i) < k
i = i + 1
Loop
Key = i
count = 0
For i = 1 To n
If a(i) = Chr(Key + 64) Then count = count + 1
If count = Then Exit For
Next i
Text3.Text = "第" + Str(k) + "小的字母是:" + Chr(Key + 64) + ";位置是:" + Str(i) End Sub