问题 单项选择题

阅读程序:
Function Fun( a As Integer)
Static c
b=0:b=b+2:c=c+2
F=a*b*c
End Function
Private Sub Commandl _ Click( )
Dim a As Integer
a=2
For i = 1 To 2
Print Fun (

A.;
Next
End

答案

参考答案:A

解析: 本题的难点是子函数调用过程和 Static变量。子函数有Static变量c,在第1次子函数调用时其值为2,局部变量b为2,但在第2次子函数调用时c=2+2=4,b=0+2=2。表达式a*b*c的结果通过子函数名F返回。

判断题
单项选择题