Option Explicit Dim s1$, s2$ Private Sub Command1_Click() Dim i As Double, j As Double Dim dblCurrentMoney As Double Dim dblTotalMoney As Double Dim dblGetMoney As Double Dim intCount As Integer Do dblCurrentMoney = dblCurrentMoney + 0.2 dblTotalMoney = dblTotalMoney + dblCurrentMoney If dblCurrentMoney * 3.4 - dblTotalMoney > intCount * 1 Then intCount = intCount + 1 s1 = s1 & Round(dblCurrentMoney / 0.2) & "," s2 = s2 & Format(dblTotalMoney, "0.00") & "," Text1.SelStart = Len(Text1.Text) Text1.SelText = Format(intCount, "00") & " " & Round(dblCurrentMoney / 0.2) & "注(" & Format(dblCurrentMoney, "0.00") & "元)" & vbTab & _ "成本: " & Format(dblTotalMoney, "0.00") & vbTab & _ "得到奖金: " & Format(dblCurrentMoney * 3.4, "0.00") & "元" & vbTab & _ "预期净赚: " & Format(dblCurrentMoney * 3.4 - dblTotalMoney, "0.00") & "元" & vbCrLf Else dblTotalMoney = dblTotalMoney - dblCurrentMoney End If If dblTotalMoney > 36 Then '最大超过36元就放弃 Exit Do End If Loop Text1.SelStart = Len(Text1.Text) Text1.SelText = vbCrLf & s1 & vbCrLf & s2 End Sub
01 1注(0.20元) 成本: 0.20 得到奖金: 0.68元 预期净赚: 0.48元
02 3注(0.60元) 成本: 0.80 得到奖金: 2.04元 预期净赚: 1.24元
03 6注(1.20元) 成本: 2.00 得到奖金: 4.08元 预期净赚: 2.08元
04 11注(2.20元) 成本: 4.20 得到奖金: 7.48元 预期净赚: 3.28元
05 18注(3.60元) 成本: 7.80 得到奖金: 12.24元 预期净赚: 4.44元
06 27注(5.40元) 成本: 13.20 得到奖金: 18.36元 预期净赚: 5.16元
07 40注(8.00元) 成本: 21.20 得到奖金: 27.20元 预期净赚: 6.00元
08 59注(11.80元) 成本: 33.00 得到奖金: 40.12元 预期净赚: 7.12元
09 86注(17.20元) 成本: 50.20 得到奖金: 58.48元 预期净赚: 8.28元
每次倍数:1,3,6,11,18,27,40,59,86
成本累计:0.20,0.80,2.00,4.20,7.80,13.20,21.20,33.00,50.20