题库 高中信息

题干

某VB程序段如下:
Function f (n As Integer) As Long
If n = 1 Then
f = 5
Else
f= 2*f(n-1) – 3
End If
End Function
Private Sub Command1_click()
Dim n As Integer
n = Val (Text1.Text)
Text2. Text = Str(f(n))
End Sub.
该程序段运行后,在文本框Text1中输入5,单击命令按钮Command1后,文本框Text2中显示的是( )
A.18B.35C.63D.123
上一题 下一题 0.99难度 选择题 更新时间:2020-03-25 10:08:24

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