题解 | #密码翻译#
密码翻译
https://www.nowcoder.com/practice/136de4a719954361a8e9e41c8c4ad855
#include <stdio.h> #include <string.h> #include <math.h> #include <string.h> #include <stdlib.h> #define MAX 81 int main(){ char str[MAX]; gets(str); int i = 0; while (str[i] != '\0'){ if ((str[i] >= 'a' && str[i] <= 'y') || (str[i] >= 'A' && str[i] <= 'Y')) str[i] = str[i]+1; else if (str[i] == 'z' || str[i] == 'Z') str[i] -= 25; i++; } printf("%s",str); }