窗体上有名称为Commandl的命令按钮。事件过程及2个雨数过程如下: Private Sub Commandl_Click() Dim X As Integer,Y As Integer,z x=3 Y=5 z=fy(Y) Print fx(fx(x))

admin2010-04-08  20

问题 窗体上有名称为Commandl的命令按钮。事件过程及2个雨数过程如下:
Private Sub Commandl_Click()
Dim X As Integer,Y As Integer,z
x=3
Y=5
z=fy(Y)
Print fx(fx(x)),y
End Sub
Function fx(ByVal a As Integer)
a=a+a
fx=a
End Function
Function fy(ByRef a As Integer)
a=a+a
fy=a
End nlnction
运行程序,并单击命令按钮,则窗体上显示的2个值依次是【  】和【  】。

选项

答案12,10

解析 函数fy中的参数a是按地址传递,函数fx中的参数a是按值传递,所以执行z=fy(y)后,y的值为10,z的值为10,x的值为3,而执行fx(fx(x))后,fx(fx(x))的为12。
转载请注明原文地址:https://jikaoti.com/ti/g6g0FFFM
0

最新回复(0)