算法1
(暴力枚举) $O(n^2)$
模拟就好了
时间复杂度
参考文献
C++ 代码
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
while(getline(cin,s)){
int n = s.size();
for(int i=0;i<n;i++){
if((s[i]>='a'&&s[i]<='z') || (s[i]>='A'&&s[i]<='Z')){
if(s[i]=='z') cout<<'a';
else if(s[i]=='Z') cout<<'A';
else cout<<char(s[i]+1);
}
else cout<<s[i];
}
cout<<endl;
}
return 0;
}