题目
设有以下函数过程:
Function fun(a As Integer,b As Integer)
Dim c As Integer
If a<b Then
c=a:a=b:b=C
End IF
c=0
Do
c=c+a
Loop Until c Mod b=0
fun=c
End Function
若调用函数fun时的实际参数都是自然数,则函数返回的是()。
A.a、b的最大公约数
B.a、b的最小公倍数
C.a除以b的余数
D.a除以b的商的整数部分
第1题
设有以下函数过程:
Function fun(m As Integer) As Integer
Dim k As Integer, sum As Integer
sum = 0
For k = m To 1 Step -2
sum = sum + k
Next k
fun = sum
End Function
若在程序中用语句 s = fun(10) 调用此函数,则s的值为______。
第2题
设有以下函数过程 Private Function Fun(a()As Integer,b As String)As Integer … End Function 若已有变量声明: Dim x(5)As Integer,n As Integer,ch As String 则下面正确的过程调用语句是()。
A.x(O)=Fun(x."ch")
B.n=Fun(n.ch)
C.CallFun X,"ch"
D.n=Fun(x(5),ch)
第3题
设有以下函数过程
Private Function Fun(a()As Integer,b As String)As Integer
…
End Function
若已有变量声明:
Dim x(5)As Integer,n As Integer,ch As String
则下面正确的过程调用语句是()。
A.x(O)=Fun(x."ch")
B.n=Fun(n.ch)
C.CallFun X,"ch"
D.n=Fun(x(5),ch)
第4题
设有如下通用过程: Public Function f(x As Integer) Dim y As Integer x = 20 y = 2 f = x * y End Function 在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private Sub Commandl Click() Static x As Integer x = 10 y = 5 y = f(x) Print x;y End Sub 程序运行后,如果单击命令按钮,则在窗体上显示的内容是
A.10 5
B.20 5
C.20 40
D.10 40
第5题
设有以下函数过程
Private Function Fun(a()As Integer,b As String)As Integer
Ehd Function
若已有变量声明:
Dim 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)
第6题
(23)设有以下函数过程
Private Function Fun(a() As Integer, b As String) As Integer
...
End Function
若已有变量声明:
Dim x(5)As Integer, n As Integer, ch As String
则下面正确的过程调用语句是
A)x(o)=Fun(x, "ch")
B)n=Fun(n, ch
C)Call Fun x, "ch"
D)n=Fun(x(5), ch)
第7题
设有以下函数过程:
Function fun(a As Integer,b As Integer)
Dim c As Integer
If a<b Then
e=a:a=b:b=c
End If
c=0
Do
c=C+a
roop Until c Mod b=0
fun=c
End Function
若调用函数fun时的实际参数都是自然数,则函数返回的是
A.a、b的最大公约数
B.a、b的最小公倍数
C.a除以b的余数
D.a除以b的商的整数部分
第8题
(25 )设有以下函数过程
Function fun(a As Integer,b As Integer)
Dim c As Integer
If a<b Then
c=a:a=b:b=c
End If
c=0
Do
c=c+a
Loop Until c Mod b=0
fun=c
End function
若调用函数 fun 时的实际参数都是自然数,则函数返回的是
A ) a 、 b 的最大公约数
B ) a 、 b 的最小公倍数
C ) a 除以 b 的余数
D ) a 除以 b 的商的整数部分
第9题
设有以下函数过程: Function fun(a As Integer,b As Integer) Dim c As Integer If a<b Then c=a:a=b:b=C End IF c=0 Do c=c+a Loop Until c Mod b=0 fun=c End Function 若调用函数fun时的实际参数都是自然数,则函数返回的是()。
A.a、b的最大公约数
B.a、b的最小公倍数
C.a除以b的余数
D.a除以b的商的整数部分
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!