[填空题] 下列程序运行后的输出结果是 (9)
Private Sub f(k,s)
s=1
For i=1 To k
s=s*i
Next
End Sub
Private Sub Command1_Click()
Sum=0
For i=1 To 3
Call f(i,s)
Sum=Sum+s
Next
Print Sum
End Sub
[填空题] 下列程序运行后的输出结果是 (9)
Private Sub f(k,s)
s=1
For i=1 To k
s=s*i
Next
End Sub
Private Sub Command1_Click()
Sum=0
For i=1 To 3
Call f(i,s)
Sum=Sum+s
Next
Print Sum
End Sub
I
本题考查的重点是在子过程的调用过程中,虚实参数的传送问题,变量s按十传送。子过程f()求n!,sum的计算过程为1!+2!+3!=1+2+6=90
VIP截止日期:2025-01-01 02:18:01
←请使用支付宝扫码支付VIP截止日期:2025-01-01 02:18:01
←请使用微信扫码支付