提交时间:2024-02-10 15:35:01

运行 ID: 40434

#include<iostream> #include<cstring> using namespace std; char a[51]; int main() { cin>>a; for(int i=0;i<strlen(a);i++){ if(a[i]>='a'&&a[i]<='w'){ a[i]+=3; a[i]+='A'-'a'; } else if(a[i]>='A'&&a[i]<='W'){ a[i]+=3; a[i]-='A'-'a'; } else if(a[i]>='w'&&a[i]<='z'){ a[i]-=25; a[i]+='A'-'a'; } else if(a[i]>='W'&&a[i]<='Z'){ a[i]-=25; a[i]-='A'-'a'; } } for(int i=0;i<strlen(a);i++){ cout<<a[strlen(a)-1-i]; } return 0; }