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中显示的内容是( )
Key = Val(Text1.Text): i = 1: j = 10
Do While i <= j
m = (i + j + 1) \ 2
t(m) = 2
If Key <= a(m) Then
j = m - 1
Else
i = m + 1
End If
Loop
For i = 1 To 10
s = s + t(i)
Next i
数组元素t(1)至t(10)初值均为0,数组元素a(1)至a(10)的值依次为“4,7,9,11,16,19,22,24,28,29”,在文本框Text1中输入待查找数,执行该程序段后,下列选项中,s的值可能的是( )
s = "python": b = 0
For i = 1 To Len(s) - 1
a = Abs(Asc(Mid(s, i, 1)) - Asc(Mid(s, i + 1, 1)))
If a > b Then b = a
Next i
Label1.Caption = Str(b)
执行该程序段后,标签Label1上显示的内容是( )
Private Sub Command1_Click()
Dim d(1 To 10) As Integer, i As Integer, j As Integer
Dim m As Integer, key As Integer, s As String
key = Int(Rnd( ) * 50) *2+ 1
s = "": i = 1: j = 10
Do While i <= j
m = (i + j) \ 2
If key = d(m) Then Exit Do
If key < d(m) Then
j = m - 1: s = s + "L"
Else
i = m + 1: s = s + "R"
End If
Loop
Label1.Caption = s
End Sub
若数组d(1)至d(10)的值依次为"11,13,20,48,51,67,70,73,80,91",若执行后 Label1 上显示2个“L”和1个“R”或2个“R”和1个“L”,则key的可取值个数为( )
⑴3个字符为一组,将它们的ASCII值转换成二进制,连接后得到24位二进制数。
⑵将得到24位二进制数重新分组,6位一组,共四组,然后在每组的数字前面补上两个零,得到32位二进制数。
⑶最后将得到32位二进制数,从低位往高位的顺序,切割成8位一组,分别将每组转换成十进制数。
现有字符的内码如下:
如果按上述规则加密,则“178”(引号中内容)加密后的结果为( )
下列说法正确的是( )
①收集反馈信息,评价修改 ②确定主题,设计目标
③规划内容结构,收集加工素材 ④选择适当工具,实际制作
比较合理的顺序是( )
Function fact(n As Integer) As String
If n = 1 Then
fact = fact & 1
Else
fact = fact(n \ 2) & n Mod 2
End If
End Function
Private Sub Command1_Click()
Dim x As String, i As Integer, r As Integer, x = Text1.Text
For i = 1 To Len(Text1.Text)
If Mid(x, i, 1) = "." Then Exit
Next i
r = Val(Mid(x, i + 1, Len(Text1.Text) - i))
Text2.Text = fact(r)
End Sub
在文本框Text1 中输入 2019.70,则执行程序段,在文本框 Text2 中显示的内容是( )