[单选题]

有如下程序: 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 6

B.6 6

C.8 8

D.10 12

参考答案与解析:

相关试题

有如下程序。 Private Sub Command1_Click()Dim k

[单选题]有如下程序。Private Sub Command1_Click()D.im k As Integer, m As IntegerD.im op As Integerk=4: m=1op=PPC(k, m) : Print op;op=PPC(k, m) : Print opE.nd SubPrivate Function PPC(a As Integer, b As Integer)Static m As Integer, i As Integerm=0: i=2i=i + m + 1m=i

  • 查看答案
  • 有如下程序:Private Sub Command1_Click()Dim k

    [单选题]有如下程序: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=m

  • 查看答案
  • 有如下的程序:Private Sub Command1_Click()Dim k

    [单选题]有如下的程序:Private Sub Command1_Click()D.im k As Integer,m AB IntegerD.im P As Integerk=4:m=1P=Fun(k,m) =Print P;P=Fun(k,m) :Print PE.nd SubPrivate Function Fun(a As Integer,b As Integer)Static m As Integer,i As Integerm=5:i=2i=i+m+1m=i+a+bF.un=m/2E.nd F

  • 查看答案
  • 有如下的程序:Private Sub Command1_Click()Dim k

    [单选题]有如下的程序: 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

  • 查看答案
  • 有如下程序。 Private Sub Command1_Click()Dim a

    [单选题]有如下程序。Private Sub Command1_Click()D.im a As SingleD.im b As Singlea=5: b=4C.all Sub1(a, b)E.nd SubSub Sub1(x As Single, y As Single)t=xx=t / yy=t Mod yE.nd Sub在调用运行上述程序后,a和b的值分别为A.0 0B.1 1C.2 2D.1 2

  • 查看答案
  • 有如下程序:Private Sub Command1_Click()Dim a

    [单选题]有如下程序: Private Sub Command1_Click() Dim a As Single Dim b As Single a=5:b=4 Call Sub1(a,b) End Sub Sub Sub1(x As Single,y As Single) t=X X=t/Y Y=t Mod y End Sub 在调用运行上述程序后,a和b的值分别为A.0 0B. 1 1C.2 2D.1 2

  • 查看答案
  • 设有如下程序:Private Sub Command1_Click() Dim

    [单选题]设有如下程序: Private Sub Command1_Click() Dim sum As Double, x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是______。A.1+1/2+2/3+3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

  • 查看答案
  • 设有如下程序:Private Sub Command1_Click() Dim

    [单选题]设有如下程序: Private Sub Command1_Click() Dim sum As Double,x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是 ______。A.1+1/2+2/3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

  • 查看答案
  • 设有如下程序:Private Sub Command1_Click( ) Dim

    [单选题]设有如下程序: Private Sub Command1_Click( ) Dim sum As Double,x As Double sum=0 n=0 For i=1 To 5 x=n/i n=n+1 sum=sum+x Next End Sub 该程序通过For循环计算一个表达式的值,这个表达式是A.1+1/2+2/3+3/4+4/5B.1+1/2+2/3+3/4C.1/2+2/3+3/4+4/5D.1+1/2+1/3+1/4+1/5

  • 查看答案
  • 有如下的程序。 Private Sub Command1_Click()Dim

    [单选题]有如下的程序。Private Sub Command1_Click()D.im k As Integer, m As IntegerD.im P As Integerk=4: m=1P=Fun(k, m) : Print P;P=Fun(k, m) : Print PE.nd SubPrivate Function Fun(a As Integer, b As Integer)Static m As Integer, i As Integerm=5: i=2i=i + m + 1m=i + a

  • 查看答案
  • 有如下程序:Private Sub Command1_Click()Dim k