[单选题]

设有如下程序: Private Sub Commandl_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.12

B.11

C.10

D.9

参考答案与解析:

相关试题

有如下程序: Private Sub Commandl_Click() Dim

[单选题]有如下程序: Private Sub Commandl_Click() Dim a As Integer a=2 For i=1 To 3 Print Gad (A)Next i End Sub Function Gad (a As Integer) b=0 Static c b=b + 1 c= c + 1 Gad= a + b + C End Function 运行上面的程序后,单击命令按钮,输出结果为A.1 2 3B.2 3 4C.4 5 6D.1 4 6

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

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

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

    [单选题]有如下的程序。 Private Sub Commandl_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 m=5:i=2 i=i+m+

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

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

  • 查看答案
  • (28)阅读程序:Private Sub Commandl_Click()Dim

    [单选题](28)阅读程序:Private Sub Commandl_Click()D.im arrD.im i As Integerarr=Array(0,1,2, 3,4, 5,6,7,8,9, 10)F.or i=0To2Print arr(7-i);NextE.nd Sub程序运行后,窗体上显示的是:A.)8 7 6B.)7 65C.)6 5 4D.)5 4 3

  • 查看答案
  • ( 33 )设有如下程序:Private Sub Commandl Click

    [单选题]( 33 )设有如下程序:Private Sub Commandl Click ()D.im sum As Double, x As Doublesum = 0n = 0F.or i=l To 5x = n / in = n + 1sum 二 sum + xNext iE.nd 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

  • 查看答案
  • 有如下事件过程:Private Sub Commandl_Click()b=10

    [单选题]有如下事件过程: Private Sub Commandl_Click() b=10 Do Until b=-1 a=InputBox(“请输入a的值”) a=Val(A) b=InputBox(“请输入b的值”) b=Val(B) a=a*b Loop Pdnt a End Sub 程序运行后,依次输入数值30,20,10,-1,输出结果为( )。A.6000B.-10C.200D.-6000

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

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

  • 查看答案
  • 设有如下程序: Private Sub Cimmandl_Click. Dim

    [单选题]设有如下程序: Private Sub Cimmandl_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/5 B.1+1/2+1/3+1/4+1/5 C.1/2+2/3+3/4+4/5 D.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 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 Commandl_click()Dim c