|
老陈 发表于 2015-4-10 10:28
高低奥马哈低牌合格公牌的概率计算程序
Dim Toatl, Qualify As Integer
高低奥马哈低牌合格公牌的概率计算程序(算法2)
Dim Toatl, Qualify As Integer
Dim NoQualify(10) As Integer
Dim Sum(12) As Integer
Dim P2 As Integer
Dim P3 As Integer
Toatl = 0
Qualify = 0
Dim I1, I2, I3, I4, I5 As Integer
Dim N1, N2, N3, N4, N5 As Integer
For I1 = 0 To 47
For I2 = I1 + 1 To 48
For I3 = I2 + 1 To 49
For I4 = I3 + 1 To 50
For I5 = I4 + 1 To 51
Toatl = Toatl + 1
N1 = I1 Mod 13
N2 = I2 Mod 13
N3 = I3 Mod 13
N4 = I4 Mod 13
N5 = I5 Mod 13
Dim K As Integer
For K = 0 To 12
Sum(K) = 0
Next
Sum(N1) = Sum(N1) + 1
Sum(N2) = Sum(N2) + 1
Sum(N3) = Sum(N3) + 1
Sum(N4) = Sum(N4) + 1
Sum(N5) = Sum(N5) + 1
For K = 0 To 7
If Sum(K) > 0 Then
P2 = P2 + 1
Next
If P2 > 2 Then Qualify = Qualify + 1
Next
Next
Next
Next
Next
TextBox1.Text = Qualify
TextBox2.Text = Toatl
TextBox3.Text = Qualify / Toatl * 100
|
|