vb代码,帮忙修正

来源:百度知道 编辑:UC知道 时间:2024/07/02 02:17:57
dim filename
filename=inputbox("type the path of the question cave")
open filename for input as#1
dim a
line input#1,a
a=val(a)
dim b
b=a-1
dim que(0,b)
dim ans(0,b)
dim c
for c=0 to b step 1
line input#1,que(c)
next c
for c=0 to b step 1
line input#1,ans(c)
next c
for c=0 to b step 1
dim nam
line input#1,nam
msgbox("ok,your cave is called"&nam)
dim right
dim wrong
dim key
dim score
right=0
wrong=0
score=0
msgbox("start!")
key=inputbox("the question is"&que(c),"answer","type your answer here")
if key=ans(c) then
msgbox("well done ,you are rihgt")
right=rigyht+1
score=score+1
else
msgbox("sorry ,you are wrong")
wrong=wrong+1
score=score-1
end if
dim tot
totj=right+wrong
dim n1 for n1=0 to a step 1
if t

1、line input#1,que(c)
应该为:
line input #1,que(c)

2、line input#1,ans(c)
应该为:
line input #1,ans(c)

3、dim n1 for n1=0 to a step 1
应该为:
dim n1
for n1=0 to a step 1

4、msgbox("your score is"&score&"right:"&right&"wrong:"&wrong&"total"&tot)
应该为:
MsgBox "your score is" & score & "right:" & right & "wrong:" & wrong & "total" & tot

这些你改完了,再在说其他的