红染月暮 @ 2020-12-23 08:18:44
#include<stdio.h>
int main(void)
{
int n;
char a;
scanf("%d",&n);
a=getchar();
while((a=getchar())!='\n')
{
if(a=='z')
{
a='a';
a+=(n-1)%26;
}
else
a+=n%26;
printf("%c",a);
}
return 0;
}
by metaphysis @ 2020-12-23 15:41:48
@红染月暮
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[])
{
int n;
char a;
cin >> n;
while(cin >> a) printf("%c", 'a' + ((a - 'a') + n) % 26);
return 0;
}