题型:综合题 题类:常考题 难易度:普通
【bj】高中信息技术综合库——解析算法及程序实现2
小王利用VB程序实现这一加密功能,程序界面和代码如下所示:
Private Sub Com_ jm_ Click()
Dim x As String, ch As String, cl As String
Dim s1 As String, s2 As String, s As String
Dim i As Integer, n As Integer, y As Integer
x= Text1. Text
n=Len(x)
For i=1 To n
ch= Mid(x, i, 1)
If ch >= "0" And ch <= "9" Then
①
s2=s2 & y
Elself ch >="a" And ch<="z" Then
y=(Asc(ch)-Asc("a")+3) Mod 26
②
s1=c1+s1
Else
y=(Asc(ch)- Asc("A")+3) Mod 26
c2=Chr(Asc("A")+y)
s1=c2+s1
End If
Next i
③
Text2 Text=s
End sub
① ② ③
试题篮