[单项选择题] 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5a=fun(i
2021-07-20
[单项选择题] 程序如下:Private Sub form_ Activate() Dim a As Integer for i=4 To 5a=fun(i)Print a, Next iEnd SubPrivate Function fun(n)As Integer if n >0 thenfun =n* fun(n-1) Elsefun=1 End ifEnd Function 程序最后打印结果是______。
A.4 5
B.12 120
C.24 120
D.24 60
正确答案:C
参考解析:函数的调用,通过函数的返回值。子过程是个递归过程,其功能是计算阶乘,即 4!=24,5!=120。
词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。
