题解 | #密码翻译#
密码翻译
https://www.nowcoder.com/practice/136de4a719954361a8e9e41c8c4ad855
#include <stdio.h> #include <string.h> int main() { char s[90]; while (gets(s)) { int len=strlen(s); for (int i=0; i<len; i++) { if (s[i]==' ') { continue; } else if (s[i]>='a'&&s[i]<'z'||s[i]>='A'&&s[i]<'Z') { s[i]+=1; }else if (s[i]=='z'||s[i]=='Z') { s[i]-=25; } } printf("%s\n",s); } return 0; }