加密规则如下表所示:
原字 |
A |
B |
C |
… |
X |
Y |
Z |
a |
b |
c |
… |
x |
y |
z |
密字 |
z |
y |
x |
… |
c |
b |
a |
Z |
Y |
X |
… |
C |
B |
A |
注:“A”的ASCⅡ码值是65,“a”的ASCI码值是97。
程序运行界面如图所示
Private sub Cmd1- Click()
Dim i As Integer, s As String, c As String, ans As String
①
For i=1 To Len(s)
c= Mid(s, i, 1)
If c<="z “And c >=”a"Or c<=”Z” And c >=”A” Then
c=②
End If
③
Next i
TxtOut. Text =ans
End Sub