qbasic题

来源:百度知道 编辑:UC知道 时间:2024/03/29 02:40:55
for i =1 to 10
n = int(90*rnd)+10
b = int(90*rnd)+10
print a;"+";b;"="
input c
if c =a+b then score =score+10
next i
print "your score is;" ;score
end
它是怎么进行随机数循环的啊,随机数是怎么变化的啊
详细一点 ,谢谢大家了

for i = 1 to 10
next i
这是强行循环的。
题中的c根本没有赋值,无法进行if c=a+b then 的判断。
随机数90*rnd 是0~90出随机数,a与b均是10~100的范围。
但是由于c的错误,变量score不能赋值,所以最终输出:
your score is 0
就这样了。