编写“素数查找”程序,实现如下功能:单击“生成”按钮,随机生成50个150至200(包括150和200)之间的正整数,显示在下方,每行显示10个,共5行。单击“筛选”按钮,从上面50个数中筛选出是素数的数,重复的只显示一次。程序运行界面如图所示。
![](http://tikupic.21cnjy.com/2021/05/12/1471a56027149112b13cba31af8bb504.jpg)
请根据算法将下列程序补充完整。
Private Sub Command1_Click()
Label3.Caption = ""
For i = 1 To 50
a(i) ={#blank#}1{#/blank#}
If i Mod 10 = 0 Then
Label3.Caption = Label3.Caption + CStr(a(i)) + vbCrLf '换行
Else
Label3.Caption = Label3.Caption + CStr(a(i)) + " "
End If
Next i
End Sub
Private Sub Command2_Click()
Label4.Caption = ""
n = 0
For i = 1 To 50
For k = 2 To a(i) - 1
If {#blank#}2{#/blank#} Then Exit For
Next k
If k = a(i) Then
n = n + 1
If n = 1 Then b(n) = a(i)
For j = 1 To n - 1
If b(j) = a(i) Then{#blank#}3{#/blank#}: Exit For
If j = n - 1 Then b(n) = a(i)
Next j
End If
Next i
For j = 1 To n
Label4.Caption = Label4.Caption + {#blank#}4{#/blank#}+ " "
Next j