解题思路:自己看
注意事项:
参考代码:
#include <stdio.h>
void encryptPassword(char* str) {
int i = 0;
while (str[i] != '\0') {
if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] = (str[i] - 'A' + 4) % 26 + 'A';
} else if (str[i] >= 'a' && str[i] <= 'z') {
str[i] = (str[i] - 'a' + 4) % 26 + 'a';
}
i++;
}
}
int main() {
char password[] = "China";
encryptPassword(password);
printf("%s\n", password);
return 0;
}
0.0分
1 人评分