题型:单选题 题类:常考题 难易度:容易
浙江省台州市书生中学2017-2018学年高二上学期信息技术第三次月考试卷
Dim a(1 To 5) As Integer
Dim f As Boolean
a(1) = 23: a(2) = 12: a(3) = 56: a(4) = 34: a(5) = 10
i = 1: f = True
Do While i <= 5 And f = True
If a(i) = 56 Then f = False
i = i + 1
Loop
Label1.Caption = i
①将该字符的ASCII码值转化为8位二进制数;
②将后4位二进制数进行按位取反(1变0,0变1);
③将操作②生成的4位二进制数均左移1位(原第1位变为新的第4位);
④原高4位二进制数连接到新的后4位二进制数成为最终加密后字符的内码。
例如:字符“a”经过上述加密运算,可得到字符“m”。
ASCII码值 |
转二进制 |
后四位取反 |
后四位左移 |
拼合 |
转十进制 |
转字符 |
97D |
01100001B |
1110 |
1101 |
01101101B |
109D |
“m” |
程序运行界面如图所示,请改正加框处有误的代码:
Private Sub Command1_Click()
Dim s As String:Dim sl As String:Dim jg As String
Dim n As Integer:Dim x As Integer:Dim i As Integer:Dim j As Integer
Dim a(15)As String
a(0)=“0000”:a(1)=“0001”:a(2)=“0010”:a(3)=“0011”
a(4)=“0100”:a(5)=“0101”:a(6)=“0110”:a(7)=“0111¨
a(8)=“1000”:a(9)=“1001”:a(10)=“1010”:a(11)=“1011¨
a(12)=“1100”:a(13)=“1101”:a(14)“1110”:a(15)=“1111”
jg=“ ”
s=Text1.Text
For i=1 To Len(s)
n=Asc(Mid(s,i,1))
low=n Mod 16
low=15-low ‘执行步骤②
s1=Mid(a(low),2,3)&Mid(a(low),1,1) ‘执行步骤③
For i=l To 4
x=x+Val(Mid(s1,j,1))* ‘⑴{#blank#}1{#/blank#}
Next j
x= *16+x ‘⑵{#blank#}2{#/blank#}
jg=jg&Chr(x)
Next i
Text2.Text=jg
End Sub
试题篮