[单项选择题] 某人为计算n! (0<n<=12)编写了下面的函数过程: Private Function fun(n As Integer) As LongDim P As LongP

11 查阅

[单项选择题] 某人为计算n! (0

A.把P=1改为P=n

B.把For k=n-1 To 2 Step-1改为For k=1 To n-1

C.把For k=n-1 To 2 Step-1改为For k=1 To n

D.把For k=n-1 To 2 Step-1改为For k=2 To n

参考答案:

B

题干中的错误在于求n!,却少乘了n,选项B也犯了同样的错误,所以答案选B。

计算机考试