[单选题]

计算n!的函数过程如下:

Private Function fact(n As Integer)As Long

f = 1

F.or i = 1 To n

f = f * i

Next i(___________________)

E.nd Function

下划线处需要编写的语句是( )。

A. f = 1

B. f = fact

C. fact = f

D. 不需要其他任何语句

参考答案与解析:

相关试题

函数过程如下:FUNCTION FUN( N AS STRING)AS STRI

[单选题]函数过程如下: FUNCTION FUN( N AS STRING)AS STRING DIM N1 AS STRING FOR I=1 TO LEN(N) N1 =UCASE(MID(N,I, 1)) + N1 NEXT I FUN: N1 END FUNCTION 则S=FUN("uvwxyz")的输出结果为( )。A.uvwxyzB.zyxwvuC.UVWXYZD.ZYXWVU

  • 查看答案
  • 设有以下函数过程Private Function Fun(a()As Integ

    [单选题]设有以下函数过程Private Function Fun(a()As Integer,b As String)As IntegerE.hd Function若已有变量声明:D.im x(5)As Integer,n As Integer,ch As String则下面正确的过程凋用语句是A.x(0)=Fun(x,“ch”)B.n=Fun(n,ch)C.Call Fun x,“ch”D.n=Fun(x(5),ch)

  • 查看答案
  • (23)设有以下函数过程Private Function Fun(a() As

    [单选题](23)设有以下函数过程Private Function Fun(a() As Integer, b As String) As Integer...E.nd Function若已有变量声明:D.im x(5)As Integer, n As Integer, ch As String则下面正确的过程调用语句是A.)x(o)=Fun(x, "ch")B.)n=Fun(n, chC.)Call Fun x, "ch"D.)n=Fun(x(5), ch)

  • 查看答案
  • 某人为计算n!(0<n<=12)编写了下面的函数过程:Private Funct

    [单选题]某人为计算n!(0<n<=12)编写了下面的函数过程:Private Function fun(n As Integer)As LongD.im P As LongP=1F.or k=n-1 To 2 Step-1P=P*kNext kfun=PE.ndFunction在调试时发现该函数过程产生的结果是错误的,程序需要修改。下面的修改方案中有3种是正确的,错误的方案是A.把P=1改为P=nB.把For k=n-1 To 2 Step-1改为For k=1 To n-lC.把For k

  • 查看答案
  • 有如下函数: Function fun(a As Integer,n As In

    [单选题]有如下函数: Function fun(a As Integer,n As Integer)As Integer Dim m AS Integer While a>=n a=a-n:m=m+1 Wend Fun=m End Function 该函数的返回值是。 A.a乘以n的乘积 B.a加n的和 C.a减n的差 D.a除以n的商(不含小数部分)

  • 查看答案
  • 有如下函数过程:Function Fun(By Val x As Ingeger

    [单选题]有如下函数过程:F.unction Fun(By Val x As Ingeger,ByVal y As Integer) As IntegerD.O While …y<>0reminder=x Mod yx=yy=reminderLoopF.un=xE.nd Function以下是调用该函数的事件过程,该程序的运行结果是Private Sub Command1_Click()D.im a As IntegerD.im b As Integera=100:b=25x=Fun(a,B)Print

  • 查看答案
  • 有如下函数过程:Function lj(x As Integer)As Long

    [单选题]有如下函数过程: Function lj(x As Integer)As Long Dims As Long Dimi As Integer s=0 Fori=1 To x s=s+i Nexti lj=s End Funcfion 在窗体上添加一个命令按钮,名为Commandl,编写事件过程调用该函数,输出结果为 ( )。 Private Sub Commandl_lick()A.25B.35C.45D.55

  • 查看答案
  • 有如下函数过程。 Function Fun(By Val x As Intege

    [单选题]有如下函数过程。F.unction Fun(By Val x As Integer,By Val y As Integer)As IntegerD.o While y<>0reminder=x Mod yx=yy=reminderLoopF.un=xE.nd Function以下调用函数的事件过程,该程序的运行结果是Private Sub Command7_Click()D.im a As Integer,b As Integera=100:b=25x=Fun(a,B)Print x

  • 查看答案
  • 有如下函数过程: Function Fun(By Val x As Ingege

    [单选题]有如下函数过程:F.unction Fun(By Val x As Ingeger, ByVal y As Integer)As IntegerD.o While … y <>0reminder=x Mod yx=yy=reminderLoopF.un=xE.nd Function以下是调用该函数的事件过程,该程序的运行结果是Private Sub Command1D.im a As IntegerD.im b As Integera=100:b=25x=Fun(a,b)Print

  • 查看答案
  • 有如下函数过程:Function Fun(By Val x As Integer

    [单选题]有如下函数过程: Function Fun(By Val x As Integer,By Val y As Integer)As Integer Do While Y<>0 reminder=x Mod y x=y y=reminder Loop Fun=x End Function 以下调用函数的事件过程,该程序的运行结果是 Private Sub Command7_Click() Dim a As Integer,b As Integer a=100:b=25 x=Fun(a,B) Prin

  • 查看答案
  • 计算n!的函数过程如下:Private Function fact(n As I