执行下列程序,运行结果是______。 Private Sub Command1_Click() s=0 Dim I As Integer For I=2.1 To 5.7 Step 0.3 s=s+1 Next Print s End SubA.13B.12C.14D.死循环

执行下列程序,运行结果是______。 Private Sub Command1_Click() s=0 Dim I As Integer For I=2.1 To 5.7 Step 0.3 s=s+1 Next Print s End Sub

A.13

B.12

C.14

D.死循环


参考答案和解析
C

相关考题:

在窗体上面画一个命令按钮,然后编写如下事件过程______ 。 Option Base 1 Private Sub Command1_Click() Dim a a=Array(1,2,3,4) j=1 For i=4 TO 1 Step -1 s=s+ a(i)*j j=j*10 Next i Print s End Sub运行上面的程序,单击命令按钮,其输出结果是______ 。A.4321B.12C.34D.1234

在窗体中有一个命令按钮command1,编写事件代码如下: Private Sub Command1_Click() Dim s As Integer s=P(1)+P(2)+P(3)+P(4) Debug.Print s End Sub Public Function P(N As Integer) Dim Sum As Integer Sum=0 For i=1 To N Sum=Sum+1 Next i P=Sum End Function 打开窗体运行后,单击命令按钮,输出的结果是( )。A.15B.20C.25D.35

在窗体上有一个命令按钮Commandl,通用过程fun和命令按钮的事件过程如下: Private Function fun(By m As Integer) If m Mod 2=0 Then fun=2 Else Fun=1 Else If End Funcion Private Sub Commandl_Click() Dim i Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出A.6 B.7 C.8 D.9

(14)有下列程序,程序运行后单击命令按钮,则输出的结果是 Private Sub Command1_Click() Dim a%(1 To 4),b%(3 To 6),i%,s1#,s2# For i=1 To 4 a(i)=i Next i For i=3 To 6 b(i)=i Next i s1=Factorial(a) S2=Factorial(b) Print"s1=";s1;"s2";s2; End Sub Function Factorial(a()As Integer) Dim t#,i% t=1 For i=LBound(a) To UBound(a) t=t*a(i) Next i Factorial=t End Factorial A.s1=360 s2=24 B.s1=24 s2=360 C.s1=24 s2=24 D.s1=360 s2=360

下面运行程序后,单击命令按钮,输出的结果是 【 】 。Private Sub Command1_Click()Dim a%(1 To 5),i%, s#For i=1 To 5a(i)=iNexts=Fun(a)Print "s="; s;End SubFunction Fun(a() As Integer)Dim t#, i%t=1For i=LBound(a) To UBound(a)t=t  a(i)NextFun=tEnd Function

设有如下程序: Private Sub Form. Click( ) Dim s As Long,f As Long Dim n As Integer,i As Integer f=1 n=4 For i=1 To n f=f*i s=s+f Next i Print s End Sub 程序运行后,单击窗体,输出结果是( )。A.32B.33C.34D.35

阅读下列程序: 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() s=P(1) +P(2) +P(3) +P(4) Print s End Sub Public Function P(N As Integer) Static Sum For i=1 To N Sum=Sum+i Next i P=Sum End FunctionA.15B.25C.35D.45

在窗体上添加一个命令按钮(其Name属性为Command1),然后编写如下代码: Option Base 1 Private Sub Command1_Click() Dim a s = 0 a = Array(4, 3, 2, 1) j = 1 For i = 4 To 1 Step -1 s = s + a(i)* j j = j * 10 Next i Print s End Sub 运行上面的程序、单击命令按钮,其输出结果是A.4321B.1234C.34D.12

现有如下程序: 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.38B.49C.61D.70

阅读下列程序: 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 Command1_Click() Dim a() a=Array(1,3,5,7) s=0 For i=1 To 3 s=s*10+a(i) Next i Print s End Sub 程序运行后,输出结果为( )。A.135B.357C.531D.753

下面运行程序后,单击命令按钮,输出出的结果是【 】。Private Sub Command1_Click( )Dim a% (1 To 5) ,i%, sFor i = 1 To 5a(i) =iNexts = Fun(a)Print"s="; s;End SubFunction Fun(a() As Integer)Dim t, i%t=1For i = LBound(A0To UBound(a)t=t * a(i)NextFun =tEnd Function

在窗体上绘制一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click() Dim i As Integer,s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是A.6B.7C.8D.9

阅读下列程序。 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 f(k,s) s = 1 for j = 1 To k s=s*j Next jEnd SubPrivate Sub Command1_ Click () Sum = 0 for i = 1 To 3 Call f(i, s) Sum = Sum + s Next i Print Sum End SubA.0B.3C.6D.9

在窗体上面1个名称为Command1的命令按钮,然后编写下列事件过程 Option Base 1 Private Sub,Command1 Click( ) Dim a(5,5)ks Integer For i=1 To j For j=1 To 5 a(i,j)=(i+j)*5\10 Next j Next i S=0 For i=1 To j s=s+a(i,i) Next i Print s End Sub 程序运行后,单击命令按钮,输出结果是( )。A.15B.13C.11D.9

程序代码如下,当单击窗体上的Command1控件时,在窗体上输出的结果是( )。 Private Sub Command1_Click() Dim aa(3,3)As Integer Dim i As Integer,j As Integer Dim s As Integer For i=0 To 3 For j=0 To 3 aa(i,j)=i*4+j+1 Next j Next i For i=0 To 3 s=s+aa(i,1) Next i Print s End SubA.32B.28C.30D.36

编写如下事件过程: Option Base 1 Private Sub Form Click() Dim x1()As Integer Dim i As Integer Dim s As Integer ReDim x1(3) For i = 1 To UBound(x1) x1(i)=i + 1 Next i Call sub1(x1) For i = 1 To UBound(x1) s = s + x1(i) Next i Print s End Sub Private Sub sub1(n()As Integer) Dim i As Integer ReDim Preserve n(5) For i = 3 To 5 n(i)=n(i-1)*2 Next i End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.6B.12C.24D.47

下面程序运行后的结果是( )。 Private Sub Form_Click() Dim s As Integer,k As Integer,i As Integer,n As Integer s=1 fori=1 to 3 forj=i to 3 for k=j to istep-1 s=s*k nextk,J,i print s End SubA.6B.72C.144D.432

在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function f(m As Integer) If m Mod 2 = 0 Then f = m Else f = 1 End If End Function Private Sub Command1_Click() Dim i As Integer s = 0 For i = 1 To 5 s = s + f(i) Next Print s End Sub 程序运行后,单击命令按钮,在窗体上显示的是A. 11B.10C.9D.8

单击窗体时,下列程序的执行结果是 Private Sub Invert(By Val xstr As String,ystr As String) Dim tempstr AS String Dim I AS Integer I=Len(xstr) Do While I>=1 tempstr=tempstr + Mid(xstr,I,1) I=I - 1 Loop ystr=tempStr End Sub Private Sub Form_Click( ) Dim s1 As String,s2 As String S1="abcdef" Invert S1,S2 Print S2 End SubA.abcdefB.afbecdC.fedcbaD.defabc

在窗体上有一个命令按钮Command1,通用过程fun和命令按钮的事件过程如下: Private Function fun(ByVal m As Integer) If m Mod 2 = 0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Cliek() Dim i As Integer, s As Integer s=0 For i=1 To 5 s=s+fun(i) Next Print s End Sub 程序运行后,单击命令按钮,则窗体上输出( )。A.6B.7C.8D.9

在窗体上画一个名称为Command1的命令按钮,然后编写如下通用过程和命令按钮的事件过程: Private Function fun(ByVal m As Integer) If m Mod 2=0 Then fun=2 Else fun=1 End If End Function Private Sub Command1_Click( ) Dim i As Integer,s As Integer S=0 For i=1 To 5 s=s+fun(i) Next Print 3 End Sub 程序运行后,单击命令按钮,在窗体上显示的是A.6B.7C.8D.9

下列程序的执行结果为 Private Sub Command1_Click() Dim s1 As String,s2 As String S1;="abcdef" Call Invert(s1,s2) Print s2 End Sub Private Sub Invert (ByVal xstr As String,ystr As String) Dim tempstr As String i=Len(xstr) Do While i=1 tempstr=tempstr+Mid(xstr,i,1) i=i-1 Loop ystr=tempstr End SubA.fedcbaB.abcdefC.afbecdD.defabc

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

下列程序的执行结果是( )。 Function P(N As Integer) For i=1 To N Sum=Sum+i Next i P=Sum End Function Private Sub Command1_Click() S=P(1)+P(2)+P(3)+P(4) Print S; End SubA.15B.16C.2OD.25

下面程序运行后,单击命令按钮,输出的结果是______。Private Sub Command1_Click()Dim a%(1 To 5),i%,sFor i=1 To 5a(i) =iNexts=Fun(A)Print "s=";s;End SubFunction Fun(a() As Integer)Dim t,i%t=1For i=LBound(A)To UBound(A)t=t*a(i)NextFun=tEnd Function