Tag: caesar cipher

C中的凯撒密码适用于较低的上部

密码适用于较低部分但不适用于上部分。 例如,如果我给一个3键,然后输入I like pie!! 要加密,我得到O olnh slh!! 我也尝试了HELLO并获得了NKRRU 。 isupper部分也返回标点而不仅仅是字母。 我还没弄清楚为什么原始消息被改变以匹配密码消息。 #include #include #include #include #include int main (int argc, string argv[]) { /* Get key from user at command line Get plaintext from user Use key to encipher text: c[i] = (p[i] + k)%26 Print ciphered message */ string message, cipher; int key; // […]