发布网友 发布时间:2022-04-20 07:34
共2个回答
热心网友 时间:2022-07-12 10:07
第一个文本框名称:text1第二个文本框名称:text2按钮名称:command1窗口名称:form1将以下代码贴到代码页中:private jc as integer '装备加成系数private cgl as double '冲装备成功系数,即你的100%/95%/……private djcs as integer '点击次数 private sub form1_load() '启动窗口时初始化 jc=0 cgl=100 djcs=0 text1.text="+0装备" text2.text=djcsend subdim i as integerprivate sub command1_click()for i=1 to 500 '最多点击500次 Randomize(timer) Dim RndNum As double RndNum = (Rnd * 100) '产生一个随机数 if rndnum < (cgl) then jc=jc+1 if jc<3 then cgl=100 if jc>=3 and jc<4 then cgl=95 if jc>=4 and jc<5 then cgl=90 if jc>=5 and jc<6 then cgl=80 if jc>=6 and jc<7 then cgl=75 if jc>=7 and jc<8 then cgl=62.1 if jc>=8 and jc<9 then cgl=53.7 if jc>=9 and jc<10 then cgl=41.4 if jc>=10 and jc<11 then cgl=33.9 if jc>=11 and jc<12 then cgl=28 if jc>=12 and jc<13 then cgl=20.7 if jc>=13 and jc<14 then cgl=17.3 if jc>=14 and jc<15 then cgl=13.6 if jc>=15 and jc<16 then cgl=10.1 if jc>=16 then msgbox("你的装备+16了,重新开始。") text1.text = "+" & jc & "装备" text2.text = "i" jc=0 cgl =100 i=501 end if else msgbox("你的装备爆了,重新开始。") text1.text = "+" & jc & "装备" text2.text = "i" jc=0 cgl =100 i=501 end ifnextend sub
热心网友 时间:2022-07-12 10:07
不明白,你要输入什么数据再测试概率,况且如果是+3,算100%还是95%?