当前位置: 高中信息技术 / 填空题
  • 1. 下列VB程序运行时,单击命令按钮Command1后,文本框Text1中显示的内容是,文本框Text2中显示的内容是

    Private Sub Command1_Click()

        Dim a(1 To 3) As Integer, k As Integer, t As Integer, s As Integer

        a(1) = 12: a(2) = 41: a(3) = 2

        s = 0

        For k = 2 To 3

            If a(k) > a(1) Then

                t = a(1): a(1) = a(k): a(k) = t

                s = s + 1

            End If

        Next k

        Text1.Text = Str(a(1))

        Text2.Text = Str(s)

    End Sub

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