_zhang_hy @ 2022-11-26 13:52:02
#include<iostream>
#include<string>
using namespace std;
int main()
{string a;
int n;
cin>>n;
cin>>a;
for(int i=0;i<a.length();i++)
{a[i]=a[i]+n%26;
if(a[i]>'z')a[i]=a[i]-26;
}
cout<<a;
return 0;
}
by ChrisWangZi @ 2022-12-23 10:25:51
@_zhang_hy
当
(具体的错误,本蒟蒻不知道)
by ChrisWangZi @ 2022-12-23 10:27:00
改了一下:
#include<iostream>
#include<string>
using namespace std;
int main()
{string a;
int n;
cin>>n;
cin>>a;
for(int i=0;i<a.length();i++)
{int x=a[i]+n%26;
if(x>'z')a[i]=x-26;
else a[i]=x;
}
cout<<a;
return 0;
}
(亲测