有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next i

admin2010-09-11  34

问题 有过程如下:Sub fact (m As Integer, total As Long)    Dim i As Integer    total = 1    for i = 1 To m        total = total*i    Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click ()    Dim tot As Long    Dim a As Integer    a = Val InputBox (“请输入数据”))    Call fact (a, tot)    Print totEnd Sub则输入数据5,运行结果为 ______。

选项 A、100
B、120
C、200
D、50

答案B

解析 本题难点是实、虚参数传递的问题。tot按ByRef参数传递。子过程的功能是计算 n!,“5!=120”。
转载请注明原文地址:https://kaotiyun.com/show/6Jmp777K
0

最新回复(0)