VB随机取8个排列组合10组输出到文本
Private Sub Command1_Click()
Dim s() As String
Dim i As Integer, j As Integer
s = Split(Text1。 Text, vbCrLf)
Text2。Text = ""
Randomize
For i = 1 To Val(Text3。Text)
Text2。Text = Text2。Text & "第" & i & "组" & vbCrLf & vbCrLf
For j = 1 To 8
Text2。 Text = Text2。Text & s(Rnd * UBound(s))
Next j
Text2。...全部
Private Sub Command1_Click()
Dim s() As String
Dim i As Integer, j As Integer
s = Split(Text1。
Text, vbCrLf)
Text2。Text = ""
Randomize
For i = 1 To Val(Text3。Text)
Text2。Text = Text2。Text & "第" & i & "组" & vbCrLf & vbCrLf
For j = 1 To 8
Text2。
Text = Text2。Text & s(Rnd * UBound(s))
Next j
Text2。Text = Text2。Text & vbCrLf & vbCrLf
Next i
End Sub。
收起