Amiee1103 @ 2022-10-03 20:24:17
差一个点
#include<bits/stdc++.h>
using namespace std;
char a[800];
int main(){
int n;
cin>>n;
cin>>a;
int la=strlen(a);
if(n>26) n=n-26;
else if(n==26) {
cout<<a;
return 0;
}
for(int i=0;i<la;i++){
if(n+a[i]>'z'){
a[i]=a[i]+n-26;
continue;
}
if((a[i]>='a'&& a[i]<'z')){
a[i]=a[i]+n;
}
else if(a[i]=='z')
a[i]='a'+n-1;
}
cout<<a;
return 0;
}
帮个忙