#include <stdio.h> #include<stdlib.h> #include<string.h> int main() { char A[30] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char a[30] = "abcdefghijklmnopqrstuvwxyz"; char S[80] = {0}; int n = 0; //printf("%c", A[0]); scanf("%[^\n]%*c", S);//解决scanf不能读取空格 int len = strlen(S); //printf("%d", len); /*while (S[n] != '\0') { n++; }*/ for (int i = 0; i <len; i++) { if (S[i] == 'z') { S[i] = 'a'; continue; } if (S[i] == 'Z') { S[i] = 'A'; continue; } for (int j = 0; j < 26; j++) { if (S[i] == A[j]) { S[i] = A[j+1]; break; } if (S[i] == a[j]) { S[i] =a[j+1]; break; } } } for (int i = 0; i < len; i++) { printf("%c", S[i]); } return 0; }