• 2021-04-14
    以下程序的输出结果为______。 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
  • 356 ; ;3

    内容

    • 0

      运行下列程序,单击窗体显示的结果为( )。 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

    • 1

      在下列程序段中,不能计算1到100之间奇数之和的是__________。 A: Dim sum As Integer sum = 0 For i = 1 To 100 Step 2 sum = sum + i Next B: Dim sum As Integer sum = 0 For i = 1 To 100 If i Mod 2 <> 0 Then sum = sum + i Next C: Dim sum As Integer sum = 0 For i = 1 To 99 sum = sum + i Next D: Dim sum As Integer sum = 0 For i = 100 To 1 Step -1 If i Mod 2 <> 0 Then sum = sum + i Next

    • 2

      下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)

    • 3

      下列程序的运行结果为( )。 Private Sub Command1_Click() Dim a(5) As String Dim i As Integer For i = 0 To 5 a(i) = i + 1 Print a(i); Next i End Sub

    • 4

      执行下列程序后,输出的结果是 Option Base 0 Dim a a = Array(13,8,4,15) m = a(0) : n = a(0) For i=1 to 3 If a(i) > m Then m = a(i) ElseIf a(i) < n Then n = a(i) End If Next i Print m; n A: 2 4 B: 4 10 C: 4 15 D: 10 15 E: 其它选项都不对