运行下面的程序,单击窗体后,从键盘上输入字符串"6",窗体上显示的输出结果为________。Private Sub Form_Click()Dim n As IntegerDim s1 As Strings1 = InputBox("输入一个字符串")n = Val(s1)Print Fact(n)End SubPrivate Function Fact(m As Integer) As LongDim s As LongIf m = 1 Thens = 1Elses = Fact(m - 1) * mEnd IfFact = sEnd Function
查看答案
执行下面的程序,第二行输出结果是___________。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,然后单击命令按钮,窗体上显示的是___________。