程序段如下,程序运行后消息框显示的结果是______。 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)? 万里|晴空|万里晴空|晴空万里
举一反三
- 运行下列程序,单击窗体显示的结果为( )。 Private Sub Form_Click() Dim a Dim s As Integer, i As Integer a = Array(1, 2, 3) For i = 2 To 0 Step -1 s = s + a(i) * a(i) Next i Print s End Sub
- 以下程序的输出结果为______。 Dim a%() = {345, -54, 200, 356, 65, 23} Dim i As Integer, m As Integer, intIndex As Integer m = a(intIndex) For i = a.GetLowerBound(0) To a.GetUpperBound(0) If a(i) > m Then m = a(i) intIndex = i End If Next MsgBox(m & " " & intIndex)? 345 ; ;1|-24 ; ;2|356 ; ;4|356 ; ;3
- 下列程序中 s = s + j 语句共执行了______次。 Dim s As Integer Dim i As Integer, j As Integer For i = 1 To 10 Step 2 For j = 1 To 5 Step 2 s = s + j Next j Next i Print s
- 中国大学MOOC: 如下程序的功能是删除文本框Text1中的数字字符。请在_________处填入适当的内容,完善程序。Private Sub Command1_Click() Dim i%, s$, c$ s = "" For i = 1 To Len(Text1.Text) c = Mid(Text1.Text, i, 1) If _________ Then s = s + c End If Next Text1.Text = sEnd Sub
- 有一段程序: a = Array(1, 2, 3, 4, 5, 6): s =1: For i = 5 To 1 Step -2: s = s * a(i): Next I, 执行后,s的结果是