当前位置: 高中信息技术 / 单选题
  • 1. (2020高二下·嘉兴期末) 有如下Visual Basic程序段:

    Private Sub Command1_ Click( )

        Dim a(1 To 10) As Integer, i As Integer, k As Integer

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

        a(6)=15:a(7)=20:a(8)=13:a(9)=7:a(10)=11

        k=0

        For i= 2 To 9

            If(a(i)-a(i-1))*(a(i+1)-a(i))< 0 Then k=k+1

        Next

        Text1. Text = Str (k)

    End Sub

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

    A . 6 B . 7 C . 8 D . 9

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