有如下函致: Function fact(x As Integer)As Long Dim p As Long,i As Integer p=1 For i=1 To x p=p*1 Next fact=p End Function 调用它的事件过程如下: Private Sub Command1_Click() i=Val(Inputbox("请输入数据")) a=fact((i)) Print a End Sub 若输入数据5,则运行结果为A.120B.60C.80D.100

有如下函致: Function fact(x As Integer)As Long Dim p As Long,i As Integer p=1 For i=1 To x p=p*1 Next fact=p End Function 调用它的事件过程如下: Private Sub Command1_Click() i=Val(Inputbox("请输入数据")) a=fact((i)) Print a End Sub 若输入数据5,则运行结果为

A.120

B.60

C.80

D.100


相关考题:

设有如下说明:var q,p:^integer; 且已知有过程调用new(p);new(q);则下面语句正确的是( ) Aread(p,q);Bp^:=q^Cp:=p+1Dp:=p+q;

●在下列程序中:Program test(input,output);var i.j:integer;procedure calc(p1,p2:integer);beginp2:=p2*p2 pl:=pl-p2;p2:=p2-p1;end{caic}begin{main}i:=2;j:=3;calc(i,j);write(j);end{main}当参数传递采用引用方式(Call by reference)时,所得结果j= (6) ;当参数传递采用换名方式(Call by name)时,所得结果,j= (7) ;当参数传递采用赋值方式(Call by value)时,所得结果,j= (8) 。(6) A.3B.6C.10D.16(7) A.3B.6C.10D.16(8) A.3B.6C.10D.16

下列等式成立的有()。 A.(F/A,i,n)=(P/F,i,n)X(A/P,i,n)B.(P/F,i,n)=(A/F,i,n)×(P/A,i,n)C.(A/P,i,n)=(F/P,i,n)×(A/F,i,n)D.(A/P,i,n)=(P/F,i,n1)×(A/F,i,n2),n1+n2=nE.(A/F,i,n)=(P/F,i,n)X(A/P,i,n)

最小生成树A.Prim算法:procedure prim(v0:integer);varlowcost,closest:array[1..maxn] of integer;i,j,k,min:integer;

链表的定位函数loc(I:integer):pointer; {寻找链表中的第I个结点的指针}procedure loc(L:linklist; I:integer):pointer;var p:pointer;j:integer;

在下列程序中:Program test(input, output);var i. j:integer;procedure calc(p1, p2: integer);beginp2: = p2 * p2 p1: = p1 - p2; p2: = p2 - p1; end {caic}begin {main} i: =2;j:=3;calc(i,j); write(j);end {main}当参数传递采用引用方式(Call by reference)时,所得结果j=(6);当参数传递采用换名方式(Call by name)时,所得结果,j=(7);当参数传递采用赋值方式(Call by value)时,所得结果,j=(8)。A.3B.6C.10D.16

1、在以下程序中,请辨析程序不同的初始状况,其中可以完成 x 的阶乘的程序是:A.输入 x p = 0 i 从 1 循环到 x p = p * iB.输入 x p = 0 i 从 0 循环到 x p = p * iC.输入 x p = 1 i 从 2 循环到 x p = p * iD.输入 x p = 1 i 从 0 循环到 x p = p * i

在以下程序中,请辨析程序不同的初始状况,其中可以完成 x 的阶乘的程序是:A.输入 x p = 0 i 从 1 循环到 x p = p * xB.输入 x p = 0 i 从 0 循环到 x p = p * xC.输入 x p = 1 i 从 2 循环到 x p = p * xD.输入 x p = 1 i 从 0 循环到 x p = p * x

在以下程序中,请辨析程序不同的初始状况,其中可以完成 x 的阶乘的程序是:A.输入 x p = 0 i 从 1 循环到 x p = p * iB.输入 x p = 0 i 从 0 循环到 x p = p * iC.输入 x p = 1 i 从 2 循环到 x p = p * iD.输入 x p = 1 i 从 0 循环到 x p = p * i