试题

试题 试卷

logo

题型:单选题 题类:常考题 难易度:普通

浙江省高中信息技术 VB基本语句同步练习

有如下VB程序段:

 Dim a(1 To 10) As Integer

 Dim s(1 To 10) As Integer

 Private Sub Form_Load()

  a(1) = 3: a(2) = 6: a(3) = 8: a(4) = 4: a(5) = 9

  a(6) = 5: a(7) = 3: a(8) = 3: a(9) = 10: a(10) = 5

 End Sub

 Private Sub Command1_Click()

 Dim i As Integer, t As Integer

 s(1) = a(1)

 For i = 2 To 10

  s(i) = s(i - 1) + a(i)

 Next i

 t = s(8) - s(4)

 Text1.Text = Str(t)

End Sub

程序运行后,文本框Text1显示的内容是(  )

A、24 B、12 C、7 D、20
举一反三
返回首页

试题篮