试题 试卷
题型:单选题 题类:常考题 难易度:普通
浙江省慈溪市2018-2019学年高二下学期信息技术期末考试试卷
Private Sub Command1 Click()
Dim a(1 To 10)As Integer
Dim i As Integer
For i=1 To 10
a(i)=i * i
Next i
List1.Add Item Str(a(i))
End Sub
运行程序,单击命令按钮Command1后,出现的错误提示为:( )
Private Sub Command1 click( )
Dim a(1 to 3) as integer,k as integer,t as integer,s as integer
a(1)=15: a(2)=36: a(3)=7
s=0
For k=2 to 3
if a(k)>a(1) then
t=a(1):a(1)=a(k):a(k)=t
s=s+1
End if
Next k
text1.text=str(a(1))
text2.text=str(s)
End sub
Private Sub Commandl_Click()
Dim i As Integer,j As Integer.s As String
Dim a(1 To 5) As Integer
List1.Clear
Randomize
j=Int(Rnd*6)+1
a(j)=a(j)+1
For i=1 To 5
s=Str(a(i))
List1.AddItem s
程序运行时,单击按钮Commandl后弹出如图所示的错误提示。出现错误的语句是( )
For i = 1 To 10
If a(i) >= 0 Then
n=n+1
List1.AddItem Str(a(i))
Else
m=m+1
List2.AddItem Str(a(i))
Next
则该程序段出错的原因是缺少了( )
①先出顺子牌型(顺子指连续的 5 张及以上的牌,如 345678,顺子最小从 3 开始,最大到 A),若有多个顺子,先长后短,长度相同按从小到大顺序出;
②再按三带一牌型(3 张相同的牌带一张单牌)、对子牌型(2 张相同)、单张牌型的顺
序出牌,同一牌型从小到大出;
③最后出炸弹,若有多个炸弹,从小到大出。
设计以下VB程序,牌“10”用0代替,比较两组出牌次数,界面如图所示,请回答下列问题。
s = "123456789"
g = ""
For i = 1 To 3
n = Len(s)
x = Int(Rnd() * n) + 1
g = g + Mid(s, x, 1)
s = Mid(s, 1, x - 1) + Mid(s, x + 1, n - x)
在程序执行时,若变量 x 的值依次为3,3,6,则最终变量g的值为( )
Private Sub Command1_Click()
Dim a As Integer,b As Integer
a=10 ‘①
b=20 ‘②
Text1.Text=“a+b=”+Val(a+b) ‘③
End Sub ‘④
发生“类型不匹配”错误时所执行的语句是( )
试题篮