程序段如下,程序运行后消息框显示的结果是______。 Dim a, s As String, i As Integer a = "晴空万里" s = "" For i = 1 To 4 Step 2 s = Mid(a, 4 - i, 2) Next MsgBox(s)A.晴空万里B.万里晴空C.晴空D.万里

程序段如下,程序运行后消息框显示的结果是______。 Dim a, s As String, i As Integer a = "晴空万里" s = "" For i = 1 To 4 Step 2 s &= Mid(a, 4 - i, 2) Next MsgBox(s)

A.晴空万里

B.万里晴空

C.晴空

D.万里


参考答案和解析
B解析: 本题中a>b返回True,即c=True,而在算术表达式中,True作为-1来处理,故消息

相关考题:

执行下列的程序,消息框里显示的结果是______。Pfivate Sub Form_Click()Dim Str As StringStr=""S="Access"For i=Len(S) To 1 Step-1Str=StrMid(S.i,1)Next IMsgBox StrEnd Sub

运行下列程序,单击窗体后输出的结果是( )。Private Sub Form_Click()Dim aDim s As Integer, i As Integera = Array(1, 2, 3, 4, 5, 6)s = 1For i = 5 To 1 Step -2s = s * a(i)Next iPrint sEnd SubA、 15B、 48C、 120D、 720

(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

有如下语句,执行后该段语句的循环次数是()。 Dim s,I,j as integer For I =1 to 3 For j=3 To 1 Step-1 S=I*j Next j Next I A. 3B. 4C. 9D. 10

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

执行下面的程序,消息框里显示的结果是_______。Private Sub Form_Click()Dim Str As StringStr=""S="Access"Fori=Len(S)To 1 Step-lStr=StrMid(S,i,1)Next iMsgBox StrEnd Sub

设有如下程序: Private Sub Form. Click( ) Dim i As Integer,x As String,y As String x="ABCDEFG" For i=4 To 1Step-1 y=Mid(X,i,i)+y Next i Print y End Sub 程序运行后,单击窗体,输出结果为( )。A.ABCCDEDEFGB.AABBCDEFGC.ABCDEFGD.AABBCCDDEEFFGG

在窗体中添加—个名称为Command1的命令按钮,然后编写如下事件代码: Private Sub Command1_Click() s="ABBACDDCBA" For I=6 To 2 Step -2 x=Mid(s,I,I) y=Left(s,I) z=Right(s,I) z=x y z Next I MSgBox z End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果是______。A.AABAABB.ABBABAC.BABBAD.BBABBA

下列程序是将两个文本框(text1和text2)的内容进行组合,组合后的结果在图片框(Pic1)显示出来。 Private Sub Command1_Click() Dim sl As String,s2 As String S1=Text1.Text S2=TextText For i=Len(s1)To 1 Step-1 s3=s3+Mid(s1,i,1)+Mid(s2,i,1) Next i Pic1.Print s3 End Sub 程序运行后,在Text1文本框中输入“ABCDE”,在Text2文本框中输入“12345”,单击命令按钮,则在Pic1图片框中显示的内容是A.E5D4C3B2A1B.ABCDE12345C.12345ABCDED.A1B2C3D4E5

已知程序段: s=0 For i=1 To 10 Step 2 s=s+1 i=i*2 Next i 当循环结束后,变量i的值为______,变量s的值为______。A.10,4B.11,3C.22,3D.16,4

以下程序段运行后消息框的输出结果为______。s="Access"Dim str As StringFor i=1 To Len(s)str=UCase(Mid(S,I,I))+strNext iMsgBox str

在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序:Private Sub s(ByVal p As Integer)p=p*2End SubPrivate Sub Command1_click()Dim i As Integeri=3Call s(i)If i>4 Then i=i^2MsgBox iEnd Sub窗体打开运行后,单击命令按钮,则消息框的输出结果为【 】。

若有以下程序,当程序运行后,单击命令按钮,则输出的结果为( )。 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 FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360

有下列程序,程序运行后单击命令按钮,则输出的结果为( )。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=";s2End SubFunction Factorial(a()As Integer)Dim t#,i% t=1 For i=LBound(A)To UBound(A) t=t*a(i) Next i Factorial=tEnd FunctionA.s1=360 s2=24B.s1=24 s2=360C.s1=24 s2=24D.s1=360 s2=360

编写如下事件过程: Private sub sub1 (ByVal x1 As String, y1 As String) Dim xt As String Dim i As Integer i = Len(x1) Do While i>= 1 xt = xt + Mid(x1, i, 1) i=i-1 Loop y1 = xt End Sub Private Sub Form. Click() Dim s1 As String, s2 As String s1= "teacher" sub1 s1, s2 Print s2 End Sub 程序运行后,单击窗体,则窗体上显示的内容是A.rehcaetB.tahreeeC.themeeD.eerthea

程序段如下: Dim i As Integer,s As Integer For i=4 To 1 Step-1 s=s+i Next i Print s,i执行的结果是( )。A.10 0B.9 1C.10 1D.9 0

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

在窗体中添加一个名为Command1的命令按钮,然后编写如下程序:Private Sub s(By Val p As Integer)p=p*2End SubPrirate Sub Command1_Click( )Dim i As Integeri=3Call s(i)If i>4 Then i=i^2MsgBox IEnd Sub窗体打开运行后,单击命令按钮,则消息框的输出结果为______。

执行下面的程序,消息框里显示的结果是( )。Private Sub Form_Click()Dim Str As String,S As String,k As IntegerS=StrFor k=Len(Str) To 1 Step -1S=S (Mid(Str,k,1)Next kEnd Sub

下列程序段运行后消息框的输出结果为______。s="Access"Dim Str As StringFor i=1 To Len(s)str=UCase(Mid(S,i,1) ) +strNext IMsgBox str

程序代码如下,当单击窗体上的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 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

已知程序段: s = 0 For i = 1 To 10 Step 2 s = s + 1 i = i * 2 Next i 当循环结束后,变量i和s的值分别为______A.10 4B.11 3C.22 3D.16 4

程序段如下; s=0 For I=5 to -1 step -2 S=s+I Next I Print I 语句S=S+I执行的次数和最后I的值分别为( )。A.3,-1B.4,-1C.4,-3D.0, 5

运行下列程序:Private Sub Command1_Click( )Dim s1 As String * 1Dim s2 As Strings1 = aFor i = Asc(s1) To Asc(s1) + 4s2 = s2 Chr(i)Next iPrint s2End Sub单击Command1命令按钮后,则在窗体上显示的结果是( )。A.aB.abcdeC.aaaaD.s2

有如下程序: 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%(1 To 4),b%(3 To 6),i%,s1,s2For i=1 To 4a(i)=iNextFor i=3 To 6b(i)=iNexts1.= Fun(a)s2 =Fun(b)Print "s1 ="; s1; "s2 ="; s2End SubFunction Fun( a( ) As Integer)Dim t, i%t=1For i = LBound(A)To UBound(a)t=t * a(i)NextFun=tEnd Function