试题

试题 试卷

logo

题型:单选题 题类:常考题 难易度:困难

浙江省高一下学期信息技术期末考试试卷

在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
举一反三
返回首页

试题篮