试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省高中信息技术 算法的基本概念及常用表示方法同步练习
Private Sub Command1_Click()
For i=1 To 4
s=””
For j=1 To 7
If Then
s=s+“*“
Else
s=s+” ” ‘双引号内为1个空格
End If
Next j
List1.AddItem s
Next i
End Sub
则方框中的语句是 ( )
Dim x As String, y As String
Dim ans As Integer
x=“5”:y=“20”:ans=0
If x>y Then ans=Val(x)Else ans=Val(y)
ans=ans+Val(x+y)
Text1.Text=Str(ans)
程序运行完后,文本框Text1中显示的是:( )
n = 0
For i = 1 To Len(Text1.Text)
c = Mid(Text1.Text, i, 1)
If c >= "0" And c <= "9" Then m = 1 Else m = 2
a(m) = a(m) + 1
If a(m) = 1 Then n = n + 1
数组a各元素的初始值都为0,文本框Text1的内容为“Happy2017”。执行程序后,变量n的值为( )
S=0 :T=1
For i=1 to 100
S=s+i*T
T=-T
①
S=0
S=s+i*(-1)^(i+1)
②
S=s+i*(-1)^i
③
S=0:S1=0:S2=0
For i=1 to 50
S1=s1+2*i-1
S2=s2+2*i
S=s1-s2
④
k = 1
For j = 2 To 100
If a(j) > a(k) Then k = j
x = a(k) 该程序段执行后,变量x中存储的是( )
试题篮