当前位置: 高中信息技术 / 单选题
  • 1. (2018·嘉兴模拟) 【加试题】某同学用VB编写如下程序:

      Private Sub Command1_Click()

        Dim k As Integer,a As Integer,b As Integer

        a=Val(Text1.Text)

        b=Val(Text2.Text)

        Label1.Caption=trans(a,b)

      End Sub

      Function trans(m As Integer,n As Integer)As String

        If m<>0 Then

           r=m Mod n

           trans=trans(m\n,n)+Str(r)

        Else

          trans=0

         End If

        End Function

    程序运行时,在文本框Text1和Text2中分别输入11和2,则Label1中的输出结果是(  )

    A . 01011 B . 1011 C . 01101 D . 11010

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