书籍编号 | 书名 | 作者 | 是否借阅 | 借阅日期 | 定价 | 借阅人编号 |
2018000001 | 我们仨 | 杨绛 | 是 | 2020/6/8 | ¥28 | Xr0236 |
2018000002 | 边城 | 沈从文 | 否 | ¥32 | ||
2019000003 | 流星雨 | 三毛 | 否 | ¥30 | ||
2019000004 | 人生 | 路遥 | 是 | 2020/7/18 | ¥26 | Cd0765 |
…… | …… | …… | …… | …… | …… |
下列说法正确的是( )
ch = Mid(s, i, 1)
If ch >= "0" And ch <= "9" Then
k = (Val(ch) - 1) Mod (Len(s) - 4) + 1
s1 = Mid(s, k, 1) + s1
End If
Next i
Text1.Text = s1
程序执行完后,Text1 中显示的内容是( )
a(1) = 23: a(2) = 32: a(3) = 46: a(4) = 38: a(5) = 15: a(6) = 55: a(7) = 39
For i = 1 To 5
For j = 2 To 7-i
If a(j) > a(j + 1) Then
t = a(j): a(j) = a(j + 1): a(j + 1) = t
c = c + 1
End If
Next j
Next i
c 的初值是0,程序执行完后,c的值是( )
k=0:s = Text1.Text For i = 0 To Len(s)-1
①
If ch >= "a" And ch <= "z" Or ch >= "A" And ch <= "Z" Then
word = word + ch
Else
For j = 1 To k
If ② Then Exit For
Next j
If ③ Then
k = k + 1
a(k) = word
End If
word = ""
End If
Next i
Text2.text=str(k)
则①②③处的代码为( )
Dim a(1 To 8) As Integer Dim i, j, m, k As Integer i = 1: j = 8
a(1) = 87: a(2) = 66: a(3) = 59: a(4) = 40: a(5) = 39: a(6) = 30: a(7) = 22: a(8) = 13
k = Val(Text1.Text)
Do While i <= j
m = (i + j + 1) \ 2
If a(m) < k Then
j = m - 1
Else
i = m + 1
Loop
Text2.Text = Str(i)
程序执行完后,i的值是4,则k的值不可能是( )
图 b
程序代码如下,请回答如下问题:
Const n = 6
Dim i, j, k As Integer Dim s As String
Dim a(1 To n * n) As Integer
Private Sub Command1_Click()
For i = 1 To n * n
Randomize
a(i) = Int(Rnd * 90) + 10
For j = 1 To i - 1
If a(j) = a(i) Then
a(i) = Int(Rnd * 90) + 10
End If
Next j
s = s + Str(a(i))
IfThen
List1.AddItem s
s = ""
End If
Next i
End Sub
Private Sub Command2_Click()
For i = 1 To n * n
k = i
For j = i + 1 To
If a(k) > a(j) Then k = j
ElseIf a(k) Mod 2 = 0 and a(j) Mod 2 = 1 Then k = j
End If
Next j
If k <> i Then t = a(k): a(k) = a(i): a(i) = t
Next i
End Sub
‘将有序的数据输出在 List2 中,代码略
①将发送信息中的每一个字符的八位二进制取反
②第1、2、4、8位上插入4个二进制数,若取反后的八位二进制数中1的个数是偶数,插入的4个二进制是1、0、1、0,否则是0、1、0、1
③将12位二进制分为3段(4位一段),每一段的最后一个数字移动到最前面,并将移动后的4位二进制数抓换为十六进制数,转换后的3位十六进制数即是加密后的字符字符"A"的加密过程如下表所示:
原文“A”转换成8位二进制数取反 |
1 0 1 1 1 1 1 0 |
插入4位二进制数1、0、1、0 |
1 0 1 1 0 1 1 0 1 1 1 0 |
4位1段,最后一个数字移动到最前面 |
1101 0011 0111 |
转换为十六进制数,即密文 |
D37 |
按照上述规则,小明设计了一个加密的VB程序,程序功能如下:在Text1中输入待加密的字符,单击“加密”按钮,将加密后的字符显示在Text2中,程序运行界面如下图所示,请回答如下问题:
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer Dim m As Integer, n As Integer, t As Integer Dim count As Integer
Dim a(1 To 12) As Integer
Dim mingw As String, miw As String
mingw = Text1.Text
For i = 1 To Len(mingw)
n = Asc(Mid(mingw, i, 1))
j = 8
Do While
a(j) = (n + 1) Mod 2 count = count + a(j)
n = n \ 2
j = j - 1 Loop
For k = 1 To 4
m = 8 + k - 1
Do While m >= 2 ^ (k - 1)
a(m + 1) = a(m)
m = m –1
Loop
Next k
For t = 1 To 3
miw =
Next t
Text2.Text = miw
Next i
End Sub
Function rev_btoh(b(i) As Integer, start As Integer, ending As Integer) As String
Dim i, sum As Integer
Const code = "0123456789ABCDEF"
sum = b(ending)
For i = start To ending - 1
sum = sum * 2 + b(i)
Next i
rev_btoh = Mid(code, sum + 1, 1)
End Function