阅读下列程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+r b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6

阅读下列程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+r b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。

A.2 3 4

B.3 4 5

C.5 6 7

D.3 5 6


相关考题:

阅读下列程序:Private Sub Command1_Click()Dim i As Integer, k As Integerk=2For i=1 To 3Print H(k) ;Next iEnd SubFunction H(j As Integer)a=0Static ba=a + 1b=b + 1H=a*b + jEnd Function程序运行后,单击命令按钮输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6

有如下程序:Private Sub Command1_Click()Dim k As Integer, m As IntegerDim p As Integerk=4: m=1p=PC(k, m) : Print p;p=PC(k, m) : Print pEnd SubPrivate Function PC(a As Integer, b As Integer)Static m As Integer, i As Integerm=0: i=2i=i + m + 1m=i + a + bPC=mEnd Function程序运行后,输出的结果为( )。A.4 6B.6 6C.8 8D.10 12

以下用户自定义函数Function Func(a As Integer,b As Integer) As IntegerStatic m As Integer,i As Integerm=0:i=2i=i+m+im=i+a+bFunc=mEnd Function在窗体上画一个命令按钮,然后编写如下事件过程:Private Sub Command1_Click()Dim k As Integer,m As Integer,p As Integerk=4:m=1P=Func(k,m)Print pEnd Sub程序运行后,单击命令按钮,输出结果为A.8B.9C.10D.11

以下程序的输出结果是D)9 12 Option Base 1 Private Sub Command1_Click() Dim s(10),p(3)As Integer k=5 For i=1 To 10 a(i)=i Next i For i=1 To 3 p(i)=a(i*i) Next I For i=1 To 3 k=k+ p(i)*2 Next i Print k End subA.33B.28C.35D.37

(28)阅读下列程序: Private Sub Commandl_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 PrintH(K); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+jEnd Function 单击命令按钮,执行程序,输出结果是A.2 3 4 B.3 4 5 C.5 6 7 D.3 5 6

阅读程序: Sub p( b () As Integer)For i =1To 4 b(i) = 2(iNext i End Sub Private Sub Command1_Click()Dim a (1 To 4) As Integer a(1)=5 a(2)=6 a(3)=7 a(4)=8 call p (a) For i=1 To 4 Print a(i) Next iEnd Sub运行上面的程序,单击命令按钮,输出结果为。

有如下的程序:Private Sub Command1_Click()Dim k As Integer,m AB IntegerDim P As Integerk=4:m=1P=Fun(k,m) =Print P;P=Fun(k,m) :Print PEnd SubPrivate Function Fun(a As Integer,b As Integer)Static m As Integer,i As Integerm=5:i=2i=i+m+1m=i+a+bFun=m\2End Function单击命令按钮后,输出结果为A. 2 2B.4 4C.5 5D.6 6

下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。A.33B.28C.35D.37

阅读下列程序: Function func(n As Integer)As Integer Sum = 0 For i = 1 To n Sum = Sum + (i + 1)* i Next i func = Sum End Function.Private Sub Command1_Click () Dim a As Integer a= 5 s = func (A)Print s End Sub 程序运行后,单击命令按钮,输出的结果为A.80B.60C.70D.15

有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim p As Integer k=4:m=1 p=PC(k,m):Print p; p=PC(k,m):Print p End Sub Private Function PC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i + m + 1 m=i + a + b PC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

有如下程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim op As Integer k=4:m=1 p=PPC(k,m):Print op; p=PPC(k.m):Print op End Sub Private Function PPC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i+m+1 m=i+a+b PPC=m End Function 程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

阅读下列程序: Private Sub Command1_Click( ) Dim i As Integer,k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) a=0 Static b a=a+1 b=b+1 H=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356

阅读下列程序: Private Sub Commad1_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 Print H(k) Next i End Sub Function H(j As Integer) a=0 Static b a=a+1 b=b+1 H=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356

在窗体中添加一个标签LblResult和一个命令按钮Command1,然后编写程序。程序的功能是单击命令按钮,计算1+2+3+4+5的值,并把结果转化为字符串显示在标签内,能够实现上述功能的程序段是, ( )A.Private Sub Command1_Click() Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Name=Str$ (R) End SubB.Private Sub Command1_ClickO Dim I,R As Integer For I=1 To 5 Step 1 R=R+I Next LblResult. Caption= Str$ (R) End SubC.Private Sub Command1_Click() Dim I,R As Integer Do While I<5 R=R+I I=I+1 Loop LblResult. Caption=Str$ (R) End SubD.Private Sub Command1_Click() Dim I,R As Integer Do R=R+I I=I+1 Loop While I<5 LblResult. Caption=Str$ (R) End Sub

阅读下列程序:PrivateSubCommand1_Click()Dim i As Integer,k As Integerk=2For i=1 To 3Print Fun(k);NextEnd SubFunction Fun(j As Integer)Static ba=0a=a+1b=b+1Fun=a*b+jEnd Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356

有如下的程序: Private Sub Command1_Click() Dim k As Integer,m As Integer Dim P As Integer k=4:m=1 P=Fun(k,m):Print P; P=Fun(k,m):Print P End Sub Private Function Fun(a As Integer,b As Integer) Static m As Integer,i As Integer in=5:i=2 i=i+m+1 m=i+a+b Fun=m\2 End Function 单击命令按钮后,输出结果为A.2 2B.4 4C.5 5D.6 6

在窗体上画一个名称为CoilTlilandl的命令按钮,然后编写如下事件过程: Private Sub command1 Click() Dim m As Integer, i As Integer, x(3)As Integer For i=0 To 3:x(i)=i:Next i For i = 1 To 2: Call sub1(x,i):Next i For i = 0 To 3: Print x(i);: Next i End Sub Private Sub sub1(a()As Integer,k As Integer) Dim i As Integer Do a(k)=a(k)+a(k+1) j = j + 1 Loop While j < 2 End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是A.0 3 7 5B.0 1 2 3C.3 2 4 5D.0 5 8 3

阅读下列程序。 Private Sub Command1_Click() Dim i As Integer,k As Integer k=2 For i=1 To 3 Print Fun(k); Next End Sub Function Fun(j As Integer) Static b a=0 a=a + 1 b=b + 1 Fun=a*b+j End Function 程序运行后,单击命令按钮输出结果是A.234B.345C.567D.356

有如下的程序。Private Sub Command1_Click()Dim k As Integer, m As IntegerDim P As Integerk=4: m=1P=Fun(k, m) : Print P;P=Fun(k, m) : Print PEnd SubPrivate Function Fun(a As Integer, b As Integer)Static m As Integer, i As Integerm=5: i=2i=i + m + 1m=i + a + bFun=m \ 2End Function单击命令按钮后,输出结果为A.2 2B.4 4C.5 5D.6 6

执行下面的程序,消息框的输出结果是【 】。Option Base1Private Sub Command1_Click( )Dim a(10),P(3)As Integerk=5For i=1 To 10a(i)=iNext iFor i=1 To 3P(i)=a(i*i)Next iFor i=1 To 3k=k+p(i)*2Next iMsgBox kEnd sub

阅读程序: Sub subP(b() As Integer) For i=1 To 4 b(i)=2 * i Next i End Sub Private Sub Command1_Click() Dim a(1 To 4) As Integer a(1)=5 a(2)=6 a(3)=7 a(4)=8 subP a() For i=1 To 4 Print a(i) Next i End Sub 运行上面的程序,单击命令按钮,输出结果为A.2 4 6 8B.5 6 7 8C.10 12 14 16D.出错

阅读下列程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i=1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+jEnd Function单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6

若有如下程序: Private Sub Command1_Click() Dim i As Integer, k As Integer k=2 For i = 1 To 3 Print H(k); Next i End Sub Function H(j As Integer) Static b a=0 a=a+1 b=b+1 H=a*b+j End Function 单击命令按钮,执行程序,输出结果是( )。A.2 3 4B.3 4 5C.5 6 7D.3 5 6

有如下程序:Private Sub Command1_Click() Dim k As Integer,m As Integer Dim op As Integer k=4:m=1 op:PPC(k,m):Print op; op:PPC(k,m):Print opEnd SubPrivate Function,PPC(a As Integer,b As Integer) Static m As Integer,i As Integer m=0:i=2 i=i+m+1 m=i+a+b PPC=mEnd Function程序运行后,输出的结果为A.4 6B.6 6C.8 8D.10 12

阅读下列程序。Private Sub Command1_Click()Dim i As Integer, k As Integerk=2For i=1 To 3Print Fun(k) ;NextEnd SubFunction Fun(j As Integer)Static ba=0a=a + 1b=b + 1Fun=a  b + jEnd Function程序运行后,单击命令按钮输出结果是A.2 3 4B.3 4 5C.5 6 7D.3 5 6

在窗体上添加如下命令按纽,然后编写如下事件过程: Private Sub Command1_Click() Dim a(10)As Integer Dim p(3)As Integer k= 5 For i = 1 To 10 a(i) = i Next i For i = 1 To 3 p(i) = a(i * i) Next i For i = 1 To 3 k = k + p(i) * 2 Next i Print k End Sub该过程的运行结果为______。A.35B.33C.31D.29

阅读程序: Sub subP(b()As Integer) For i=1 To 4 b(i)=2*i Next i End Sub Private Sub Command1_Click() Dim a(1 To 4)As Integer a (1)=5 a (2)=6 a (3)=7 a (4)=8 subP a() For i=1 To 4 Print a(i) Next i End Sub运行以上程序,单击命令按钮,输出结果为______ 。A.2 4 6 8B.5 6 7 8C.10 12 14 16D.出错