z13323110392 @ 2023-10-10 14:14:38
3 4 5个点WA了
#include<bits/stdc++.h>
using namespace std;
long long n;string s;
int main(){
cin>>n;
cin>>s;
for(int i=0;i<s.size();i++){
if(s[i]=='z'){
s[i]=('a'+n-1)%'z';
}else {
s[i]=(s[i]+n)%'z';
}
}
cout<<s;
return 0;
}
by yutong_Seafloor @ 2023-10-10 14:37:40
码风真的毒瘤……
可以把其中的 (s[i]+n)%'z';
改成 s[i]=(s[i]+n-'a')%26+'a';
,s[i]=('a'+n-1)%'z';
也要改
@z13323110392
by z13323110392 @ 2023-10-10 14:48:05
@yutong_Seafloor 谢谢大佬