vb程序 要求将输入的原字符串转换成大写字符串后进行加密,并输出加密字符串
2个回答
展开全部
Dim s As String
Private Sub Command1_Click()
's = InputBox("请输入一个英文字符串:")
s = "I have an English book.It has 1234 pages."
For i = 1 To Len(s)
C = UCase(Mid(s, i, 1))
If C >= "A" And C <= "Z" Then
C = Chr(Asc(C) - 3)
If C < "A" Then C = Chr(Asc(C) + 26)
End If
Mid(s, i, 1) = C
Next i
MsgBox ("加密后的字符串是:" & vbCrLf & s)
End Sub
Private Sub Command2_Click()
For i = 1 To Len(s)
C = Mid(s, i, 1)
If C >= "A" And C <= "Z" Then
C = Chr(Asc(C) + 3)
If C > "Z" Then C = Chr(Asc(C) - 26)
End If
Mid(s, i, 1) = C
Next i
MsgBox ("解密后的字符串是:" & vbCrLf & s)
End Sub
Private Sub Command1_Click()
's = InputBox("请输入一个英文字符串:")
s = "I have an English book.It has 1234 pages."
For i = 1 To Len(s)
C = UCase(Mid(s, i, 1))
If C >= "A" And C <= "Z" Then
C = Chr(Asc(C) - 3)
If C < "A" Then C = Chr(Asc(C) + 26)
End If
Mid(s, i, 1) = C
Next i
MsgBox ("加密后的字符串是:" & vbCrLf & s)
End Sub
Private Sub Command2_Click()
For i = 1 To Len(s)
C = Mid(s, i, 1)
If C >= "A" And C <= "Z" Then
C = Chr(Asc(C) + 3)
If C > "Z" Then C = Chr(Asc(C) - 26)
End If
Mid(s, i, 1) = C
Next i
MsgBox ("解密后的字符串是:" & vbCrLf & s)
End Sub
2015-05-05
展开全部
如果方便的话去医院就疹当然是最好了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询