从20中抽5个进行组合排列怎么写VB代码让最终的结果显示在记事本中
来源:百度知道 编辑:UC知道 时间:2024/05/22 14:15:58
'写的一个双色球 带文件写入 自己改改吧!~
Private Sub Command1_Click()
Dim strTem As String
Dim intTem As Integer
Dim sName() As String
Dim i As Integer
Dim j As Integer
Dim iTemp As Integer
Dim aa As Integer
Do
intTem = Int(Rnd * (34 - 1)) + 1
If InStr(1, strTem, CStr(intTem)) = 0 Then
strTem = strTem + CStr(intTem) + "."
i = i + 1
If i > 5 Then Exit Do
End If
Loop
sName() = Split(strTem, ".")
For i = 0 To UBound(sName()) - 1
For j = 0 To i - 1
If Val(sName(j)) > Val(sName(j + 1)) Then
iTemp = sName(j)
sName(j) = sName(j + 1)
sName(j + 1) = iTemp
End If
Next
Next
For i = 0 To UBound(sNa