Private Sub Command1_Click() Dim i As Integer, j As Integer //定义一个整形i,定义一个整形j Dim a(10) As Integer For i = 0 To 9 a(i) = Int(Rnd * 90) //产生随机的10个整数 For j= 0 To i - 1 //比较是否有相同的数,有的返回开始 If a(j) = a(i) Then GoTo start End If Next Next For i = 0 To 9 Print a(i) Next End Sub