题解
2023-06-25 15:12:50
发布于:上海
67阅读
0回复
0点赞
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
char a[1000];
gets(a);
int len = strlen(a);
int n=1;
for(int i=0;i<len;i++){
if(a[i]>='A' and a[i]<='Z'-n){
a[i]=a[i]+n;
}
else if(a[i]>='a' and a[i]<='z'-n){
a[i]=a[i]+n;
}
else if(a[i]>'Z'-n and a[i]<='Z'){
a[i]=a[i]-(26-n);
}
else if(a[i]>'z'-n and a[i]<='z'){
a[i]=a[i]-(26-n);
}
}
cout<<a;
return 0;
}
这里空空如也
有帮助,赞一个