①阿里vr购物中,用户带上头盔,眼前立刻出现梦幻般的购物景象,并进行购物;②与机器人对弈;③扫描图书中文字并保存为图片;④手机语音智能拨号;⑤利用人眼虹膜进行考勤
执行该算法,输入n的值为13,下列说法正确的是( )
For i = 1 To 6
a(i) = Int(Rnd * 10) + 1
Next i
For i = 2 To 6
If i Mod 2 = 0 And a(i)>a(i-1) Then
t=a(i):a(i)=a(i-1):a(i-1)=t
Else
a(i)=a(i)-1
End If
Next i
执行程序后,数组元素a(1)到a(6)的值可能是( )
i = 1: j = 63: n = 0
Do While i <= j
m = (i + j) \ 2
If key = a(m) Then Exit Do
ElseIf key < a(m) Then j = m - 1: n = n - 1
Else
i = m + 1: n = n + 1 End If
Loop
数组元素a(1)到a(63)存放着递增的数据。若执行该程序段后,n 的值为 6,则下列表达式成立的是( )
i = n
Do While i >=2
k = i
For j = To 1 Step -1
If a(j) > a(k) Then k = j
Next j
If i <> k Then
t = a(k): a(k) = a(i): a(i) = t
End If
Loop
则下列说法正确的是( )
Function delStr(S As String, m As Integer) As String
Dim n As Integer
n = Len(S)
If m < 1 Or m > n Then
delStr = ”输入位置有误!”
ElseIf m = 1 Then
delStr = Mid(S, 2, n - 1)
ElseIf m < n Then
ElseIf m = n Then
delStr = Mid(S, 1, n - 1)
End If
End Function
则横线处代码填写正确的是( )
请回答下列问题:
图a
图b
图c
用户从Text1中输入计划人数,单击“入围划线”按钮Command1,面试分数线显示在文本框Text2 中,入围面试最终人数显示在 Text3中,进入面试考生的考号和笔试成绩显示在List2列表框中,如果成绩相同,则按考号从小到大的顺序显示。程序界面如图所示。
Dim kh(1 To 500) As String, cj(1 To 500) As Integer
Dim n As Integer ′参加考试总人数
Private Sub Form_Load()
Dim conn As New ADODB.Conncction
Dim rs As New ADODB.Recordset
conn.ConnectionString = “Provider=Microsoft.ACE.OLEDB.12.0;datasource=”+App.Path + ”\BSCJ.accdb”
conn.Open
Set rs.ActiveConnection = conn
rs.Open “select * FROM scoreinfo”
′本过程其他代码略
End Sub
Private Sub Commandl_click()
Dim m As Integer, i As Integer, j As Integer
Dim t1 As Integer, t2 As String, flag As Boolean
For i = 1 To n - 1
For j = 1 To
If cj(i) < cj(j) Then
t1 = cj(i): cj(i) = cj(j): cj(j) = t1
t2 = kh(i): kh(i) = kh(j): kh(j) = t2
EleIf ① Then
t2 = kh(i): kh(i) = kh(j): kh(j) = t2
End If
Next j
Next i
m = ②
If m <= n Then
i = m
flag = Flase
Do While i < n And Not flag
If cj(i) = cj(i + 1) Then
i = i + 1
Else
③
End If
Loop
Text2.Text = Str(cj(m))
Text3.Text = Str(i)
For j = 1 To i
List2.Addltem kh(j) + “ ” + Str(cj(j))
Next j
Else
Text2.Text = “面试人数超过了总人数”
End If
End Sub
① ② ③
明文:HelloWorld
密钥:abcabcabca
密文:HfnlpYosnd
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
|
A |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
B |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
C |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
D |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
E |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
F |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
G |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
H |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
I |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
J |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
K |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
L |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
M |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
N |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
O |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
P |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
Q |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
R |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
S |
S |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
T |
T |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
U |
U |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
V |
V |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
W |
W |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
X |
X |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
Y |
Y |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Z |
Z |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
依据上述算法描述设计了如下VB程序。请回答下列问题:
Const MIN_ASC = 65 ′字母“A”的ASCII值
Function X2D(x As String) As String ′字符串小写转成大写
Dim s As String, zf As String, i As Integer
s = “”
For i = 1 To Len(x)
zf = Mid(x, i, 1)
If zf >= “a” And zf <= “z” Then
s = s +
Else
s = s + zf
End If
Next i
X2D = s
End Function
Private Sub Command1_Click()
Dim M As String, K As String, C As String, flag As Boolean
Dim i As Integer, t As Integer, ch As Integer, pos As Integer, j As Integer
M = Text1.Text ′明文
K = Text2.Text ′密钥
t = Len(K)
K = X2D(K) ′将密钥全部转成大写
C = “ ” ′加密后的结果
For i = 1 To Len(M)
ch = Asc(Mid(M, i, 1))
flag = False
If ch >= 97 And ch <= 122 Then ch = ch - 32: flag = True
pos = ′密钥的字符位置值
If pos = 0 Then pos = t
j = Asc(Mid(K, pos, 1)) ′密钥字符的ASCII值
ch = ch - MIN_ASC
j = j - MIN_ASC
ch =
ch = ch + MIN_ASC
If flag Then ch = ch + 32 ′设置字母的大小写形式
C = C & Chr(ch)
Next i
Text3.Text = C
End Sub