现有如下程序: Private Sub Command1_Click() Public Function f(x As Integer) s=0 If x>=10 T

admin2020-01-02  19

问题 现有如下程序:
    Private Sub Command1_Click()     Public Function f(x As Integer)
    s=0                                  If x>=10 Then
    For j=1 To 5                            t=x+1
    s=s+f(5+i)                           Else
    Next                                    t=x+2
    Print s                              End If
    End Sub                              f=t
                                      End Function
    运行程序,则窗体上显示的是

选项 A、38
B、49
C、61
D、70

答案B

解析 本题考查的考点是有关函数调用和If语句的。要注意在前4次循环中每次调用f函数时传递的参数分别为6、7、8、9,都是小于10的,最后一次循环传递参数10,所以最终结果应该为8+9+10+11+11=49。
转载请注明原文地址:https://kaotiyun.com/show/imTp777K
0

最新回复(0)