以下用户自定义函数 Function Func(a As Integer, b As Integer) As Integer Static m As Integer, i As Integer m=0:i=2

admin2010-03-30  37

问题 以下用户自定义函数      Function Func(a As Integer, b As Integer) As Integer      Static m As Integer, i As Integer           m=0:i=2           i=i+m+i           m=i+a+b     Func=m    End Function    在窗体上画一个命令按钮,然后编写如下事件过程:    Private Sub Command1_Click()    Dim k As Integer,m As Integer,p As Integer       k=4:m=1       P=Func(k,m)       Print p    End Sub    程序运行后,单击命令按钮,输出结果为

选项 A、8
B、9
C、10
D、11

答案1

解析 变量i的计算过程为i=2+0+1 =3,变量m的计算过程为m=3+4+1=8,m的值通过于函数名Fune返回。
转载请注明原文地址:https://jikaoti.com/ti/ejq0FFFM
0

最新回复(0)