题库 高中信息

题干

有如下 VB 程序段:
Function fact(n As Integer) As String If n = 1 Then
fact = fact & 1
Else
fact = fact(n \ 2) & n Mod 2
End If
End Function
Private Sub Command1_Click()
Dim x As String, i As Integer, r As Integer x = Text1.Text
For i = 1 To Len(Text1.Text)

If Mid(x, i, 1) = "." Then Exit For Next i

r = Val(Mid(x, i + 1, Len(Text1.Text) - i)) Text2.Text = fact(r)
End Sub
在文本框Text1 中输入 2019.70,则执行程序段,在文本框 Text2 中显示的内容是( )
A.1000110B.70C.350D.100011
上一题 下一题 0.99难度 选择题 更新时间:2020-01-17 04:48:35

答案(点此获取答案解析)