MornHus @ 2022-08-29 16:40:59
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
char a;
while(cin>>a){
a+=n;
if(a>'z')a%=26;
cout<<a;
}
return 0;
}
by int9 @ 2022-08-29 17:47:39
哦你早调过了,哈哈哈白浪费1min了
by zhizhi_c @ 2022-08-30 10:41:57
@zjybb 您的代码段
while(cin>>a){
a+=n;
if(a>'z')a%=26;
cout<<a;
}
改为
string s;
while(cin>>a){
if(a+n>'z') a-=26; //防爆
a+=n;
s+=a;
}
cout<<s;
这样可能可以。