至於我為什么會發這篇文章的原因 如圖:
就有那么一點類似於字符的轉換(可以參考這篇博文):https://blog.csdn.net/qq_52510306/article/details/118551560
只不過是多了一點算法罷了
接下來就是代碼環節了 上代碼:
```c #include<stdio.h> int main() { char c; scanf_s("%c", &c); if (c >= 'a' && c < 'z')//也可以使用(c>=97&&c<=122);作為篩選條件 { c = c + 3; printf("經轉換后輸出字符為:%c", c); } else if (c >= 'A' && c < 'Z')//同理 { c = c + 3; printf("經轉換后輸出字符為:%c", c); } else { printf("不符合規范,請重新輸入"); } } ```
tip:這是單個字母的加密罷了 如果想要多個加密 可以參考https://blog.csdn.net/qq_41071068/article/details/88694153
然后就是運營結果圖啦:
over~~