当前位置: 高中信息技术 / 单选题
  • 1. (2021高三上·浙江开学考) 有如下 VB 程序段:

    Dim a(1 To 6) As Integer

    Dim d(1 To 6) As Integer

    a(1) = 10: a(2) = 21: a(3) = 28: a(4) = 11: a(5) = 12: a(6) = 30

    Const n = 6

    For i = n To 1 Step -1

        d(i) = 0

        For j = n To i +1 Step -1

            If a(j) > a(i) Then d(i) = d(j) + 1

        Next j

        If d(i) > Max Then Max = d(i)

    Next i

    Text1.Text = Str(Max)

    执行该程序段,文本框Text1中显示的是(   )

    A . 1 B . 2 C . 3 D . 4

微信扫码预览、分享更方便