试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省丽水市五校共同体2020-2021学年高二上学期信息技术10月阶段性考试试卷
Dim n As Integer
Dim a(1 To 100)As Integer
Private Sub Command1_Click() ‘生成n个有序数,显示在List1中
‘代码略
End Sub
Private Sub Command2_Click()
Dim t As Integer
Dim i As Integer
Dim j As Integer
Dim temp As Integer
t=Val(Text2.Text)
For i= To n ‘(1)
temp=a(i)
For j=i To i+1-t Step-1
a(j)=a(j-1)
Next j
=temp ‘(2)
Next i
For i=1 To n
List2.AddItem Str(a(i))
n=Len(s) ‘s是待判断的字符串
k=0:j=n
For i=1 To n/ 2
If k=0 Then Labell Caption=“对称”Else Labell.Caption=“不对称”
方框中的代码由以下三部分组成:
①j=j-1 ②If cl <> c2 Then k=k+1 ③cl=Mid(s,i,l):c2=mid(s,j,l)
代码顺序正确的选项是( )
s = "Hello World"
s1 = ""
n = Len(s)
For i = 1 To n \ 2
If Mid(s, i, 1) > Mid(s, n - i + 1, 1) Then
s1 = s1 + Mid(s, i, 1)
Else
s1 = Mid(s, n - i + 1, 1) + s1
End If
Text1.Text = s1
执行该程序段后,在文本框Text1中显示的是( )
For i= 1 To 2
For j=5 To i+1 Step-1
If a(j) >a(i) Then
t=a(j):a(j)=a(i):a(i)=t
数组元素a(1)到a(5)的值依次为“33,24,45,16,77”,经过该程序段“加工”后,数组元素a(1)到a(5)的值依次为( )
当输入x的值为100时,在标签Label1中输出的内容为( )
①x=y ②y=x ③t=x ④x=t ⑤y=t ⑥t=y
试题篮