wkm010202 @ 2017-04-08 21:26:33
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string s;
int n;
cin>>n>>s;
for(int i=0;i<s.size();i++)
{
s[i]=n%26+s[i];
while(s[i]>122)
{
s[i]-=26;
}
}
cout<<s<<endl;
return 0;
}
by a1825055081 @ 2017-04-11 20:04:18
while(s[i]>122)
{
s[i]-=26;
}
字母有可能是大写的,你这里只考虑了小写情况;