则字符“TOP5”的内码是( )
序号 | 编码标准 | 采样频率 | 量化位数 | 声道 |
① | PCM | 22.050KHz | 8位 | 单声道 |
② | PCM | 22.050KHz | 16位 | 双声道 |
③ | PCM | 44.100KHz | 8位 | 单声道 |
④ | PCM | 44.100KHz | 16位 | 双声道 |
图a
图b
Dim a(1 To 10)As Integer
Dim i As Integer, s as string
a(1)=1
For i =2 To 10
a(i)=a(i-1)*i
s=St(a(i))
①授权码由9位字符组成,前三位为日期的密文,最后1位为验证码;
②日期的最后1位数字k(若k的值为0,令k=10),加密成26个大字英语字母表该位置对应的字母。
③将26个大写英文字母向左移k(日期的最后1位数字)个位置,并将移出的k个字母依次连接到最后。例如当k=3时,形成如下表所示新的字母排列顺序:
位置 |
1 |
2 |
3 |
4 |
…… |
23 |
24 |
25 |
26 |
字母 |
D |
E |
F |
G |
…… |
Z |
A |
B |
C |
④日期的第1个数字至第7个数字的加密方法是:计算第i个位置上的数字与第i+1个位置的数字及位置i三者相加的和,在新的字母表中取出该数字和对应的字母,作为第i个位置上数字加密字符。
⑤计算日期的各个位置上数字之和sum,若和sum的值大于26,在新的英文字表中,sum Mod 26对应字母转换成小写字母,作为验证码,否则验证码为新的英文字母表中对应字母。
Private Sub Command1_Click()
Dim i As Integer, j As Integer, s As String, k As Integer
Dim mw As String, sum As Integer, t As Integer, t1 As Integer
strl="0123456789"
s=Text1.Text
①
t=k: sum=t
s1=Mid(strl, t+1, 1)
For i=7 To 1 Step-1
t1=Asc(Mid(s, i, 1))-64
j= ②
s1=Mid(strl1, t+1, 1)+s1
sum=sum+t
Next i
mw=jm(k)
If sum>26 Then
sum=sum Mod 26
ch=Chr(Asc(Mid(mw, sun, 1))+32)
Else
ch=Mid(mw, sum, 1)
End If
If ch=Mid(s, 9, 1) Then Text2.Text=s1
Else Text2.Text="该系列号未能通过验证!"
End Sub
Function jm(t As Integer) As String
Dim i As Integer, p As Integer
If t=0 Then t=10
For i=1 To 26
p=(t+i-1) Mod 26
③
Next i
End Function
① ② ③
i = 1: j = 9: flag = False
Key = Val(Text1.Text)
Do While i < j
m = (i + j + 1) \ 2
If a(m) > Key Then j = m - 1 Else i = m + 1
If a(m) = Key Or a(m + 1) = Key Then flag = True: Exit Do
Loop
If flag Then
If a(m) = Key Then Text2.Text = Str(m) Else Text2.Text = Str(m + 1)
Else
Text2.Text = "找不到"
End If
程序运行时,数组元素a(1)到a(9)中的数据为12,24,27,34,39,46,68,73,84,在文本框Text1中输入“68”,执行该程序段,则下列表达式正确的是( )
Const n=5
Dim a(1 to n) as integer, i as integer, j as integer, k as integer, t as integer
For i=1 to n
a(i)=int(rnd*20+1)
Next i
For i=1 to n-1
k=i
For j=i+1 to n
If a(j) mod 2=1 then
If a(k) mod 2=0 or a(j)>a(k) then k=j
ElseIf a(k) mod 2=0 and a(j)>a(k) then
k=j
End if
Next j
If k<>i then t=a(k): a(k)=a(i): a(i)=t
Next i
该程序段运行结束后,a(1)~a(5)可能是( )