vb 双色球 随机 选号
来源:百度知道 编辑:UC知道 时间:2024/06/07 20:54:24
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 * (14 - 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(sName()) - 1
Text1(i).Text = Format(sName(i), "00")
Next
Text2.Text = Int(Rnd * (17 - 1)) + 1
aa = Va
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
Randomize
intTem = Int(Rnd * (14 - 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) - 2
For j = i + 1 To UBound(sName) - 1
If Val(sName(i)) > Val(sName(j)) Then
iTemp = sName(i)
sName(i) = sName(j)
sName(j) = iTemp
End If
Next
Next
For i = 0 To UBound(sName()) - 1
Text1(i).Text