当前位置:好百科>百科知识>VB凯撒密码要求如图 急急急急急求

VB凯撒密码要求如图 急急急急急求

2024-11-26 00:29:36 编辑:zane 浏览量:556

VB凯撒密码要求如图 急急急急急求

的有关信息介绍如下:

VB凯撒密码要求如图 急急急急急求

Private Sub Command1_Click()

  n = CInt(Text3)

  s = Text1

  For i = 1 To Len(s)

    c = UCase(Mid(s, i, 1))

 余亏   If c >= "A" And c <= "Z" Then

     州颤 If Asc(c) > Asc("Z") - n Then

        c = Chr(Asc(c) + n - 26)

      Else

        c = Chr(Asc(c) + n)

      End If

      Mid(s, i, 1) = c

    End If

  Next i

  Text2 = s

End Sub

Private Sub Command2_Click()

  n = CInt(Text3)

  s = Text2

  For i = 1 To Len(s)

    c = UCase(Mid(s, i, 1))

    If c >= "A" And c <= "Z" Then

      If Asc(c) < Asc("A") + n Then

        c = Chr(Asc(c) - n + 26)

      Else

       册毁败 c = Chr(Asc(c) - n)

      End If

      Mid(s, i, 1) = c

    End If

  Next i

  Text1 = s

End Sub

Private Sub Form_Load()

  Text1 = ""

  Text2 = ""

  Text3 = ""

  

End Sub

版权声明:文章由 好百科 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.haobaik.com/article/220700.html
热门文章