题干

某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:1

B:3

C:5

D:7

上一题 下一题 0.0难度 选择题 更新时间:2019-07-09 05:50:01

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

C