Option explicit <br/> dim S1 $, S2 $ <br/> private sub commandementclick () <br/> dim I as double, J as double <br/> dim dblcurrentmoney as double <br/> dim dbltotalmoney as double <br/> dim dblgetmoney as double </P> <p> dim intcount as integer </ p> <p> DO <br/> dblcurrentmoney = dblcurrentmoney + 0.2 <br/> dbltotalmoney = dbltotalmoney + dblcurrentmoney <br/> If dblcurrentmoney * 3.4-dbltotalmoney> intcount * 1 then <br/> intcount = intcount + 1 <br/> S1 = S1 & round (dblcurrentmoney/0.2) & "," <br/> S2 = S2 & format (dbltotalmoney, "0.00") & "," <br/> text1.selstart = Len (text1.text) <br/> text1.seltext = format (intcount, "00") & "& round (dblcurrentmoney/0.2) &" Note ("& format (dblcurrentmoney," 0.00 ") & "yuan)" & vbtab & _ <br/> "cost:" & format (dbltotalmoney, "0.00") & vbtab & _ <br/> "get a bonus: "& format (dblcurrentmoney * 3.4," 0.00 ") &" meta "& vbtab & _ <br/>" expected net profit: "& format (dblcurrentmoney * 3.4-dbltotalmoney, "0.00 ") & "meta" & vbcrlf <br/> else <br/> dbltotalmoney = dbltotalmoney-dblcurrentmoney <br/> end if </P> <p> If dbltotalmoney> 36 then' maximum if you exceed 36 RMB, give up <br/> exit do <br/> end if <br/> loop </P> <p> text1.selstart = Len (text1.text) <br/> text1.seltext = vbcrlf & S1 & vbcrlf & S2 <br/> end sub
01 1 Note (0.20 yuan) Cost: 0.20 get a bonus: 0.68 yuan expected net profit: 0.48 yuan
02 3 Note (0.60 RMB) Cost: 0.80 yuan received bonus: 2.04 yuan expected net profit: 1.24 yuan
03 6 Note (1.20 yuan) Cost: 2.00 get a bonus: 4.08 yuan expected net profit: 2.08 yuan
04 11 Note (2.20 yuan) Cost: 4.20 get a bonus: 7.48 yuan expected net profit: 3.28 yuan
05 18 Note (3.60 yuan) Cost: 7.80 get a bonus: 12.24 yuan expected net profit: 4.44 yuan
06 27 Note (5.40 yuan) Cost: 13.20 get a bonus: 18.36 yuan expected net profit: 5.16 yuan
07 40 Note (8.00 yuan) Cost: 21.20 get a bonus: 27.20 yuan expected net profit: 6.00 yuan
08 59 Note (11.80 yuan) Cost: 33.00 get a bonus: 40.12 yuan expected net profit: 7.12 yuan
09 86 Note (17.20 yuan) Cost: 50.20 get a bonus: 58.48 yuan expected net profit: 8.28 yuan
Multiples of each time: 1, 3, 6, 11, 18, 27, 40, 59, 86
Cost accumulation: 0.20, 0.80, 2.00, 4.20, 7.80, 13.20, 21.20, 33.00, 50.20