#include <stdio.h> #include <string.h>

int main() { char str[100]; scanf("%[^ ]", str); // 读入一行字符串,注意要包含空格,使用%[^ ]格式 int len = strlen(str); for (int i = 0; i < len; i++) { if (str[i] >= 'a' && str[i] <= 'y') { // 小写字母a~y str[i] = str[i] + 1; // 加密 } else if (str[i] == 'z') { // 小写字母z str[i] = 'a'; // 转换成小写字母a } } printf("%s", str); // 输出加密后的字符串 return 0; }

C语言实现简单字母加密程序

原文地址: https://www.cveoy.top/t/topic/nV45 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录