[单选题]

现有如下程序: Private Sub Command1_Click() s=0 For i=1 To 5 s=s+f(5+i) Next Print s End Sub Public Function f(x As Integer) If x>=10 Then t=x+1 Else t=x+2 End If f=t End Function 运行程序,则窗体上显示的是( )。

A.38

B.49

C.61

D.70

参考答案与解析:

相关试题

有如下程序:Private Sub Command1_Click()s = 0D

[单选题]有如下程序: Private Sub Command1_Click() s = 0 Do s=(s+1) ( (s+2) N=N+1 Loop Until s>=10 Print N;s End Sub 运行后的输出结果是A.0 1B.30 30C.4 30D.2 12

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

    [单选题]设有如下程序: Private Sub Command1_Click() Dim sum As Double, k As Double sum=0 n=0 For i=1 To 5 k=n/i n=n+1 sum=sum+k 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 s

    [单选题]设有如下程序: 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 i End Sub 该程序通过For循环来计算一个表达式的值,这个表达式是( )。A.1+1/2+2/3+3/4+4/5B.1+1/2+1/3+1/4+1/5C.1/2+2/3+3/4+4/5D.1/2+1/3+1/4+1/5

  • 查看答案
  • 有如下程序。 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() as="

    [单选题]有如下程序: Private Sub Command1_Click() as="A WORKER IS HERE" x = Len(a$) For i=1 To x - 1 b$ =Mid$(a$, i,3) If b$ ="WOR" Then S=S+ 1 Next Print S End Sub 单击命令按钮,程序运行结果为A.1B.2C.3D.5

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

    [单选题]有如下程序:Private Sub Command1_Click()a$="A WORKER IS HERE"x=Len(a$)F.or i=1 To x-1b$=Mid$(a$,i,3)If b$="WOR",Then S=S+1NextPrint SE.nd Sub单击命令按钮,程序运行结果为AA.1B.2C.3D.5

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

    [单选题]有如下程序:Private Sub Command1_Click()a$="A WORKER IS HERE"x=Len(a$)F.or i=1 To x - 1b$=Mid$(a$, i, 3)If b$="WOR" Then S=S + 1NextPrint SE.nd Sub单击命令按钮,程序运行结果为A.1B.2C.3D.5

  • 查看答案
  • 有如下程序: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() a$="

    [单选题]有如下程序: Private Sub Command1_Click() a$="A WCIRKER IS HERE" x=Len(a$) For i=1 To x-1 b$=Mid$(a$,i,3) If b$="WOR"Then S=S+1 Next Print S End Sub 单击命令按钮,程序运行结果为A.1B.2C.3D.5

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

    [单选题]有如下程序: Private Sub Command1_Click( ) a$="A WORKER IS OVER THERE" x=Len(a $) For i=1 To x-1 b$=Mid $(a $,i,2) If b $="ER"Then s=s+1 Next i Pdnt s End Sub 程序运行后的输出结果是A.1B.2C.3D.4

  • 查看答案
  • 现有如下程序:Private Sub Command1_Click() s=0