执行下面的程序,第二行输出结果是___________。Option ExplicitPrivate Sub Form_Click()Dim I As Integer, J As IntegerI = 2: J = 3Call Test(I, J)Print I, JCall Test(I, J)Print I, JEnd SubPrivate Sub Test(M As Integer, N As Integer)Static Sta As IntegerM = M + NN = N + M + StaSta = Sta + MEnd Sub
查看答案
执行下面的程序,输出结果是___________。Option ExplicitPrivate Sub Form_Click()Dim M As Integer,N As IntegerM=2:N=3Print M+N+F(M,N);M=1:N=2Print F(M,N)+F(M,N)End SubPrivate Function F(X As Integer,Y As Integer)X=X+YY=X+3F=X+YEnd Function
执行下面的程序,输出结果是___________。Private Sub Command1_Click()Dim a As Integer, b As Integer, c As Integera = 3b = 4c = 5Print f2(c, b,a)End SubPrivate Function f1(x As Integer, y As Integer, z As Integer)f1 = 2 * x + y + 3 * zPrint f1;End FunctionPrivate Function f2(x As Integer, y As Integer, z As Integer)f2 = f1(z, x, y) + xPrint f2;End Function
在窗体上画一个名称为Text1的文本框,一个名称为Command1的命令按钮,然后编写如下事件过程和通用过程:Private Sub Command1_Click()n=Val(Text1.Text)If n\2=n/2 Thenf=f1(n)Elsef=f2(n)End IfPrint f;nEnd SubPublic Function f1(ByRef x)x=x*xf1=x+xEnd FunctionPublic Function f2(ByVal x)x=x*xf2=x+x+xEnd Function程序运行后,在文本框中输入10,然后单击命令按钮,窗体上显示的是___________。
假定有以下函数过程:Function Fun(S As String)As StringDim s1 As StringFor i = 1 To Len(S)s1 = UCase(Mid(S,i,1))+s1Next iFun = s1End Function在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Dim Str1 As String, Str2 As StringStr1 = InputBox("请输入一个字符串")Str2 = Fun(Str1)Print Str2End Sub程序运行后,单击命令按钮,如果在输入对话框中输入字符串"abcd1234",则单击"确定"按钮后在窗体上的输出结果为___________。