sjl40 @ 2017-10-28 07:14:24
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,i,j;
string a;
int main()
{
cin>>n;
getchar();getline(cin,a);
for(i=1;i<=n;i++)
for(j=0;j<a.size();j++){if(a[j]!='z')a[j]++;else a[j]='a';}
cout<<a;
}
by GXuLuogu @ 2017-11-02 16:29:33
#include<cstdio>
#include <iostream>
#include<cstring>
using namespace std;
char p[26];
int main()
{
int n;
scanf("%d%s",&n,&p);
n%=26;
int len=strlen(p);
for (int i=0;i<len;i++)
{
unsigned char m=(p[i]+n); //不用这个要爆~~
if (m>'z') p[i]='a'+(m-'z')-1;
else p[i]=m;
}
for (int i=0;i<len;i++)
printf("%c",p[i]);
return 0;
}