设有如下程序: Private Static Function Fac(n As Integer)As Integer Dim f As Integer f=f+n Fac=f

admin2013-04-11  19

问题 设有如下程序:       Private Static Function Fac(n As Integer)As Integer            Dim f As Integer            f=f+n            Fac=f       End Function       Private Sub Form_Click(   )           Dim I As Integer           For 1=2 To 3                 Print"#";I&“=”&Fac(1)           Next I      End Sub     程序运行后,单击窗体,在窗体上显示的是

选项 A、#2=2        #3=3
B、#2=2       #3=5
C、#;2=2       #;3=3
D、#;2=2   #3;=5

答案2

解析 由于Print方法中的分号表示前后字符之间的连接,并不显示在窗体中,同时由于Function过程以Static定义,在I=3时,Fac(1)的值为5。
转载请注明原文地址:https://kaotiyun.com/show/Hlhp777K
0

最新回复(0)