A.3 | B.4 | C.5 | D.6 |
'读取各装箱清单中的物品编号存入a数组,每张清单的物品数量存入b数组
c = Mid(s, i, 1)
If c >= "0" And c <= "9" Then
value = value + c
Else
xy(j) = Val(value): value = ""
End If
For j = 1 To n
If j >= xy(1) And j <= xy(3) And i >= xy(2) And i <= xy(4) Then
b((i - 1) * n + j) =
Else
b((i - 1) * n + j) = a((i - 1) * n + j)
End If
Next j
c = c + Str(b(i))
if
List2.AddItem c
c=””
end if
'读取所有单词存入数组a,并显示在列表框List1中
'初始化数组b各元素为空字符串,代码略
Dim i As Integer, j As Integer, k As Integer, p As Integer, max As Integer
Dim m As Integer, key As String, t As String, s1 As String, s2 As String
key="2223334445556667778889999" 'key表示a-z各个字母所对应的键盘数字
max=0
'以下代码实现将数组a中的每个单词转化成按键组合,并依次存入数组b中
For i= 1 To n
For j= 1 To Len(a(i))
m=Asc(Mid(a(i),j, 1))-Asc("a")
t=
Next j
B(i)= t
Next i
For j=1 To i
If b(j+1)< b(j)Then
t=b(j+1): b(j+l)= b(j): b(j)=t
End If
Next j
i=i-1
s2= b(j)
If s1 <> s2 Then
If
max=j-i
p=n+1
b(p)=s1
ElseIf max=j-iThen
p=p+1
b(p)=s1
End If
s1=s2
End If
j=j+l
Loop
t=" "
If max<j-I Then
t=sl
Else
Fork=n+1 To p
t=t+ b(k)+" "
Next k
If max=j-I Then t=t+" "+s1
End If
Text1.Text= "最频繁按键组合为: " &t
data[leng][1]=p
head=
q=data[p][1]
c=0
while c < pos-1 and q!=-1:
p=q
q=data[p][1]
c+=1
data[p][1]=leng
s.append
p=data[p][1]