cilinya @ 2020-10-09 11:00:23
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
char a[51];
cin>>n;
cin>>a;
for(int i=0;i<strlen(a);i++){
if(a[i]>='a'&&a[i]<'z'){
a[i]+=n;
}else if(a[i]=='z'){
a[i]='a'+n-1;
}
}
cout<<a;
return 0;
}
by Sktain @ 2020-10-09 11:03:52
你没判断是否超过'z'
by Reobrok_Kk @ 2020-10-09 11:18:56
谢谢提供水题
by 小仓朝阳 @ 2020-10-09 13:02:13
兄弟你看不起红题?
by cilinya @ 2020-10-10 17:27:04
@Sktain 感谢提醒哦