早教吧 育儿知识 作业答案 考试题库 百科 知识分享

如何解读这段内码?CBF5D0B45043CAC7D6B8怎样判断以上内码包含四个汉字和两个西文字符?

题目详情
如何解读这段内码?
CB F5 D0 B4 50 43 CA C7 D6 B8
怎样判断以上内码包含四个汉字和两个西文字符?
▼优质解答
答案和解析
CB F5 D0 B4 50 43 CA C7 D6 B8 是:
缩写PC是指
其中,中文4个,西文2个
用 VB 判断
Private Sub Command1_Click()
Dim nStr As String,B() As Byte,S As Long,I As Long
nStr = "CB F5 D0 B4 50 43 CA C7 D6 B8" '
ReDim B(1 To 1)
For I = 1 To Len(nStr) - 1 Step 3
S = S + 1:ReDim Preserve B(1 To S)
B(S) = "&H" & Mid(nStr,I,2)
Next
nStr = StrConv(B,vbUnicode)
I = Len(nStr)
S = (S - I)
MsgBox nStr & ":中文" & S & "个,西文" & I - S & "个",vbInformation
End Sub