AniuKarry @ 2021-12-05 21:28:12
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int i,n,m;
char a[101];
cin>>m;
cin>>a;
n=strlen(a);
for(i=1;i<=n;i++)
{
a[i]+=m;
if(a[i]>='z')
{
m=m%26;
a[i]='a'+m;
}
}
puts(a);
}
by ud2_ @ 2021-12-05 21:34:50
数组下标从 0 开始。
by FQR_ @ 2021-12-05 21:45:22
@13850375639aniu
字符串读入从