试题 试卷
题型:单选题 题类:常考题 难易度:普通
第三单元 第一章 算法及算法的表示 基础巩固
执行该算法,当x的值为5时,( )
Dim i As Integer, Sum As Integer
Dim a(1 To 11) As Integer
Sum = 6
a(11) = 49
For i = 10 To 1 Step -1
a(i) = a(i + 1) - 1
If a(i) Mod 3 = 0 Then Sum = Sum + a(i)
Next i
Text1.Text = Str(Sum)
该程序段运行后,文本框text1中显示的内容是( )
n = Len(Text1.Text)
For i = 1 To n
a(i) = Mid(Text1.Text, i, 1)
Do While n > 1
If Asc(a(n)) >= Asc(a(n - 1)) Then
m = 1
Else
m = 2
End If
b(m) = b(m) + 1
n = n-1
Loop
数组b各元素的初始值都为0,文本框Text1的内容为“2018Python”。执行程序后,变量b(1)的值为( )
Dim a(3, 3) As Integer
For m = 1 To 3
For n = 1 To 3
a(m, n)=(m-1)*3+n
Next n
Next m
For m = 2 To 3
For n = 1 To 2
Print a(n, m);
运行后输出结果是( )
试题篮