sanhuzhen @ 2024-04-10 21:01:11
#include <iostream>
#define int long long
using namespace std;
string s;
signed main() {
int n;
while(cin>>n){
cin.ignore();
getline(cin,s);
for(int i = 0;i<s.size();i++){
s[i] += n;
if(s[i]>'z'){
s[i]-=26;
}
}
cout<<s<<endl;
}
return 0;
}
by Union_Find @ 2024-04-10 21:13:44
26
zzz
过不了
by Union_Find @ 2024-04-10 21:14:41
z 的编号是
by sanhuzhen @ 2024-04-10 21:37:59
@Union_Find 但我后面又减去26了呀
by Union_Find @ 2024-04-10 22:00:55
因为你在加上去的时候就已经爆 char 了,要改成 int 在强转 char。
by sanhuzhen @ 2024-04-13 12:31:48
@Union_Find 哦哦,感谢