组卷题库 > 高中信息技术试卷库
试题详情
【加试题】有如下VB程序段:

Dim a(5) As Integer

Dim i As Integer, j As Integer, t As Integer

a(1) = 52: a(2) = 15: a(3) = 37: a(4) = 22: a(5) = 35

i = 1

Do While i < 5

    t = i: j = i + 1

    Do While j <= 5

        If a(j) > a(t) Then t = j

        j = j + 1

    Loop

    x = a(t): a(t) = a(i): a(i) = x

    i = i + 1

Loop

Text1.Text = Str(a(2))

运行该段代码后,文本框Text1中显示的内容为(   )

A、15
B、22
C、37
D、35
知识点
参考答案
采纳过本试题的试卷
教育网站链接