从1到33的数中任选六位数的排列。用vb编程
发布网友
发布时间:2022-07-26 23:20
我来回答
共3个回答
热心网友
时间:2023-10-23 07:59
Private Sub Command1_Click()
Dim RN(6) As Long
Dim i As Integer
Dim OutTxt As String
Randomize (6)
For i = 0 To 5
RN(i) = Int(33 * Rnd() + 1)
Next
If RN(5) = RN(4) + 1 And RN(4) = RN(3) + 1 And RN(3) = RN(2) + 1 And RN(2) = RN(1) + 1 And RN(1) = RN(0) + 1 Then
OutTxt = "连续六位数,不符合要求!"
GoTo out
End If
If RN(5) = RN(4) + 1 And RN(4) = RN(3) + 1 And RN(3) = RN(2) + 1 And RN(2) = RN(1) + 1 Or RN(4) = RN(3) + 1 And RN(3) = RN(2) + 1 And RN(2) = RN(1) + 1 And RN(1) = RN(0) + 1 Then
OutTxt = "连续五位数,不符合要求!"
GoTo out
End If
If RN(5) = RN(4) + 1 And RN(4) = RN(3) + 1 And RN(3) = RN(2) + 1 _
Or RN(4) = RN(3) + 1 And RN(3) = RN(2) + 1 And RN(2) = RN(1) + 1 _
Or RN(3) = RN(2) + 1 And RN(2) = RN(1) + 1 And RN(1) = RN(0) + 1 Then
OutTxt = "连续四位数,不符合要求!"
GoTo out
End If
If RN(5) = RN(4) + 1 And RN(4) = RN(3) + 1 _
And RN(2) = RN(1) + 1 And RN(1) = RN(0) + 1 Then
OutTxt = "两个连续三位数,不符合要求!"
GoTo out
End If
'Print RNumber
Cls
Print RN(0) & " " & RN(1) & " " & RN(2) & " " & RN(3) & " " & RN(4) & " " & RN(5)
Exit Sub
out:
MsgBox OutTxt, 64, "提示信息"
End Sub
热心网友
时间:2023-10-23 07:59
for i1=1 to 28 step 1
for i2=2 to 29 step 1
for i3=3 to 30 step 1
for i4=4 to 31 step 1
for i5=5 to 32 step 1
for i6=6 to 33 step 1
if i1=i2-1 and i2=i3-1 and i3=i4-1 and i4=i5-1 and i5=i6-1
loop &&六连
endif
if i1=i2-1 and i2=i3-1 and i3=i4-1 and i4=i5-1 or i2=i3-1 and i3=i4-1 and i4=i5-1and i5=i6-1
loop &&五连
endif
if i1=i2-1 and i2=i3-1 and i3=i4-1 or i2=i3-1 and i3=i4-1 and i4=i5-1 or i3=i4-1 and i4=i5-1 and i5=i6-1
loop &&四联
endif
if i1=i2-1 and i2=i3-1 and i4=i5-1 and i5=i6-1
loop &&双三联
endif
print i1,i2,i3,i4,i5,i6
next i1
next i2
next i3
next i4
next i5
next i6
热心网友
时间:2023-10-23 08:00
大哥,双色球呢?我有,你要我发你 ,包括相连,同上期,012路等。