Caesar Cipher Shift (using alphabet array)

前端 未结 3 1277
遇见更好的自我
遇见更好的自我 2020-12-21 06:00

I am currently writing a Caesar Cipher program in C# for my assignment and I am having a problem.

I am approaching this task using an array where I store the whole a

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 06:38

    Why don't you just use character's ASCII values. I would convert ciphertext to lower case first. For example a's asci value is 97. I would write a method to extract 97 every characters so a=0,b=1..... z=25. Then for every character in your ciphertext get -3 shifted value of that char.For example input char d should return value 0 which corresponds a.

提交回复
热议问题