利用随机函数产生50个 [1,4] 之间的整数,分别统计出1的个数,2的个数,3的个数和4的个数.Private Sub Form_click()Dim N%,c1%,c2%,i%,c3%,c4%i = 1c1 = 0c2 = 0c3 = 0c4 = 0Do While i〈 = 50N = Int(Rnd * 4 + 1)Select Case NCase 1c1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 09:45:12
利用随机函数产生50个 [1,4] 之间的整数,分别统计出1的个数,2的个数,3的个数和4的个数.Private Sub Form_click()Dim N%,c1%,c2%,i%,c3%,c4%i = 1c1 = 0c2 = 0c3 = 0c4 = 0Do While i〈 = 50N = Int(Rnd * 4 + 1)Select Case NCase 1c1
利用随机函数产生50个 [1,4] 之间的整数,分别统计出1的个数,2的个数,3的个数和4的个数.
Private Sub Form_click()
Dim N%,c1%,c2%,i%,c3%,c4%
i = 1
c1 = 0
c2 = 0
c3 = 0
c4 = 0
Do While i〈 = 50
N = Int(Rnd * 4 + 1)
Select Case N
Case 1
c1 = c1 + 1
Case 2
c2 = c2 + 1
Case 3
c3 = c3 + 1
Case 4
c4 = c4 + 1
End Select
i = i + 1
Loop
Print c1,c2,c3,c4
End Sub
请问哪里有问题,
利用随机函数产生50个 [1,4] 之间的整数,分别统计出1的个数,2的个数,3的个数和4的个数.Private Sub Form_click()Dim N%,c1%,c2%,i%,c3%,c4%i = 1c1 = 0c2 = 0c3 = 0c4 = 0Do While i〈 = 50N = Int(Rnd * 4 + 1)Select Case NCase 1c1
就只是一个标点<=你打错了,拓成了中文标点,于是就杯具了.更改一个符号,一切OK: