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中輸入待查找數,執(zhí)行該程序段后,下列選項中,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)
執(zhí)行該程序段后,標簽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",若執(zhí)行后 Label1 上顯示2個“L”和1個“R”或2個“R”和1個“L”,則key的可取值個數為( )
⑴3個字符為一組,將它們的ASCII值轉換成二進制,連接后得到24位二進制數。
⑵將得到24位二進制數重新分組,6位一組,共四組,然后在每組的數字前面補上兩個零,得到32位二進制數。
⑶最后將得到32位二進制數,從低位往高位的順序,切割成8位一組,分別將每組轉換成十進制數。
現(xiàn)有字符的內碼如下:
如果按上述規(guī)則加密,則“178”(引號中內容)加密后的結果為( )
下列說法正確的是( )
①收集反饋信息,評價修改 ②確定主題,設計目標
③規(guī)劃內容結構,收集加工素材 ④選擇適當工具,實際制作
比較合理的順序是( )
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,則執(zhí)行程序段,在文本框 Text2 中顯示的內容是( )