GodRaymond @ 2019-08-10 23:16:16
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s,a;
int n;
cin>>n;
int nn=(n-1)%26+1;
cin>>a;
for(int i=0;a[i]!='\0';i++)
{
if(a[i]+nn>'z') s[i]=a[i]+nn-26;
else s[i]=a[i]+nn;
cout<<s[i];
}
cout<<endl;
return 0;
}
不知道出什么问题了,我还多考虑了一步。
by 吾皇 @ 2019-08-10 23:47:29
@大佬崔 emmm你可以加一个特判,
if(nn==0){
cout<<a;
return 0;
}
by 4biu @ 2019-08-11 00:48:46
名字好评
emm别老红题呀qwq
by 4biu @ 2019-08-11 00:51:41
这题n不能负数吗?
by GodRaymond @ 2019-08-11 14:11:23
@cuichenxi
第三组数据:入:
26
qwertyuiopasdfghjklzxcvbnm
出:
qwertyuiopasdfghjklzxcvbnm
by 4biu @ 2019-08-11 23:07:48
@大佬崔 那不是对了吗
by GodRaymond @ 2019-08-11 23:16:52
@cuichenxi