vb.net 2010 口算出题器问题
fori=0to19...List1.Items.Add(n1&a(oper)&n2&"=")...next运行时并没有出20道题,而是只出了一道题。在点击“提交答案”时...
for i = 0 to 19
...
List1.Items.Add(n1 & a(oper) & n2 & "=")
...
next
运行时并没有出20道题,而是只出了一道题。
在点击“提交答案”时,在VB6中没有问题的一句竟出错了:
请大家帮忙
整个一个过程是这样的:
For i = 0 To 19
Randomize()
oper = Int(Rnd() * 4)
Randomize()
n1 = Int(Rnd() * 9999 + 1)
Randomize()
n2 = Int(Rnd() * 999 + 1)
While n1 Mod n2 > 0 And oper = 3
Do Until n1 Mod n2 = 0
Randomize()
n2 = Int(Rnd() * 999 + 1)
Loop
End While
While n2 >= n1 And oper = 1
Randomize()
n2 = Int(Rnd() * 99 + 1)
End While
List1.Items.Add(n1 & a(oper) & n2 & "=")
Select Case oper
Case 0
RightAnswer(i) = n1 + n2
Case 1
RightAnswer(i) = n1 - n2
Case 2
RightAnswer(i) = n1 * n2
Case 3
RightAnswer(i) = n1 / n2
End Select
Next 展开
...
List1.Items.Add(n1 & a(oper) & n2 & "=")
...
next
运行时并没有出20道题,而是只出了一道题。
在点击“提交答案”时,在VB6中没有问题的一句竟出错了:
请大家帮忙
整个一个过程是这样的:
For i = 0 To 19
Randomize()
oper = Int(Rnd() * 4)
Randomize()
n1 = Int(Rnd() * 9999 + 1)
Randomize()
n2 = Int(Rnd() * 999 + 1)
While n1 Mod n2 > 0 And oper = 3
Do Until n1 Mod n2 = 0
Randomize()
n2 = Int(Rnd() * 999 + 1)
Loop
End While
While n2 >= n1 And oper = 1
Randomize()
n2 = Int(Rnd() * 99 + 1)
End While
List1.Items.Add(n1 & a(oper) & n2 & "=")
Select Case oper
Case 0
RightAnswer(i) = n1 + n2
Case 1
RightAnswer(i) = n1 - n2
Case 2
RightAnswer(i) = n1 * n2
Case 3
RightAnswer(i) = n1 / n2
End Select
Next 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询