[单选题]

有如下程序:

Private Sub Command1_Click()

a$="A WORKER IS HERE"

x=Len(a$)

F.or i=1 To x - 1

b$=Mid$(a$, i, 3)

If b$="WOR" Then S=S + 1

Next

Print S

E.nd Sub

单击命令按钮,程序运行结果为

A.1

B.2

C.3

D.5

参考答案与解析:

相关试题

有如下程序: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 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()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 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()DimC

    [单选题]设有如下程序: Private Sub Command1_Click() Dim C As Integer, d As Integer c=4 d=InputBox(“请输入一个整数”) Do While d>0 If d>c Then c=c+1 End If d=InputBox(“请输入一个整数”) Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、 9和0,则输出结果是A.12B.11C.10D.9

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

    [单选题]设有如下程序: 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+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()a$="