当前位置: 高中信息技术 / 单选题
  • 1. (2019高一下·浙江期末) 在Visual Basic中,有如下程序:

    Private Sub Command1_Click()

      Dim a As Integer, b As Integer, c As Integer

      Dim d As Integer, z As Integer

      a = Val(Text1.Text): b = Val(Text2.Text): c = Val(Text3.Text)

      d = max(a, b)

      z = max(d, c)

      Text4.Text = Str(d)

      Text5.Text = Str(z)

    End Sub

    Function max(x As Integer, y As Integer) As Integer

      If x > y Then max = x Else max = y

    End Function

    运行该程序,在文本框Text1、文本框Text2、文本框Text3中分别输入2、-5、6后,单击命令按钮Command1,文本框Text5中显示的是(  )

    A . -5 B . 2 C . 6 D . 24

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