一啦啦啦一 @ 2019-07-18 15:05:43
P1914 小书童——密码 求救!
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
string article,password;
int n,i,j;
cin>>n;
cin>>article;
for(i=0;i<article.length();i++)
{
if(article[i]+n<='z') password[i]=article[i]+n;
else password[i]='a'-1+n-('z'-article[i]);
}
for(i=0;i<article.length();i++) cout<<password[i];
return 0;
}
by 一啦啦啦一 @ 2019-07-23 21:34:50