F.unction fun(m As Integer) As Integer
D.im k As Integer, sum As Integer
sum = 0
F.or k = m To 1 Step -2
sum = sum + k
Next k
fun = sum
E.nd Function
若在程序中用语句 s = fun(10) 调用此函数,则s的值为______。
[单选题]假定有以下函数过程: Function Fun(S As String) As String Dim sl As String For i=1 To Len(S) s1=UCase (Mid(S,i,1))+s1 Next i Fun=s1 End Function则Str2=Fun("abcdefg”)的输出结果为( )。A.abcdefgB.ABCDEFGC.gfedcbaD.GFEDCBA
[单选题]( 25 )设有以下函数过程F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thenc=a:a=b:b=cE.nd Ifc=0D.oc=c+aLoop Until c Mod b=0fun=cE.nd function若调用函数 fun 时的实际参数都是自然数,则函数返回的是A. ) a 、 b 的最大公约数B. ) a 、 b 的最小公倍数C. ) a 除以 b 的余数D. ) a 除以 b 的商的整数部分
[单选题]设有以下函数过程:F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thenc=a:a=b:b=CE.nd IFc=0D.oc=c+aLoop Until c Mod b=0fun=cE.nd Function若调用函数fun时的实际参数都是自然数,则函数返回的是( )。A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分
[单选题]设有以下函数过程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)
[单选题]设有以下函数过程:F.unction fun(a As Integer,b As Integer)D.im c As IntegerIf a<b Thene=a:a=b:b=cE.nd Ifc=0D.oc=C+aroop Until c Mod b=0fun=cE.nd Function若调用函数fun时的实际参数都是自然数,则函数返回的是A.a、b的最大公约数B.a、b的最小公倍数C.a除以b的余数D.a除以b的商的整数部分
[单选题](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)
[单选题]设有如下通用过程: Public Sub Fun(a(), ByVal x As Integer) For i=1 To 5 x = x + a(i) Next End Sub 在窗体上画一个名称为Text1的文本框和一个名称为Command1的命令按钮,然后编写如下的事件过程: Private Sub Commandl Click() Dim arr(5) As Variant For i=1 To 5 arr(i) =i Next n = 10 Call Fun(arr(), n) Text
[单选题]( 26 )以下关于函数过程的叙述中,正确的是A. )函数过程形参的类型与函数返回值的类型没有关系B. )在函数过程中,过程的返回值可以有多个C. )当数组作为函数过程的参数时,既能以值方式传递,也能以传址方式传递D. )如果不指明函数过程参数的类型,则该参数没有数据类型
[单选题]设有如下通用过程: Public FunctionFun(x Str As String)As String DimtStr As String,strL As Integer tStr="" strL=Len(xStr) i=1 DoWhilei<=strL/2 tStr=tStr&Mid(xStr,i,1)&Mid(xStr,strL-i+1,1)" i=i+1 Loop Fun=tStr End Function 在窗体A.ABCDEFB.abcdefC.AFBECD
[单选题]在函数过程中的任意位置要退出当前函数过程,应用()命令。A . EndFunctionB . ExitC . ExitFunctionD . ExitSu