题库 高中信息

题干

(加试题)某VB程序使用了递归函数,代码如下:
Private Sub Command1_Click()
Text1.Text = f(3)
End Sub
Function f(x As Integer) As String
If x = 1 Then  f = 1  Else  f = f(x - 1) + 2
End Function
运行程序并点击按钮Command1后,文本框Text1中显示的内容是( )
A.1B.3C.5D.7
上一题 下一题 0.99难度 选择题 更新时间:2017-02-15 04:28:21

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