问题
单项选择题
现有如下程序:
Private Sub Command1_Click()
s=0
For i=1 To 5
s=s+f(5+i)
Next
Print s
End Sub
Public Function f(x As Integer)
If X>=10 Then
t=x+1
Else
t=x+2
End If
f=t
End Function
运行程序,则窗体上显示的是
A.38
B.49
C.61
D.70
答案
参考答案:B
解析: 题中参数x<=4时函数返回值分别为8、9、10、11,而x=5时函数返回值为11,所以总和为49。