加密整数.对于一个4位正整数,将每一位上的数字加7,

1个回答

  • Private Sub Command1_Click()

    Dim a%,b%,c%,d%,e%

    e = CInt(Text1.Text)

    a = (e 1000 + 7) Mod 10

    b = (e 100 Mod 10 + 7) Mod 10

    c = (e 10 Mod 10 + 7) Mod 10

    d = (e Mod 10 + 7) Mod 10

    e = a:a = d:d = e

    e = b:b = c:c = e

    Text2.Text = a & b & c & d

    End Su