ShepherdZ @ 2019-11-01 19:44:32
int main()
{
int n;
char A[51];
int a[51];
scanf("%d\n", &n);
int i;
for (i = 0;i<=50; i++)
{
scanf("%c", &A[i]);//扫描字符
a[i] = A[i];//存储ASCLL码
if (a[i] == 10)break;//扫描到\0停止,字符串长度为i,用A[0~i-1]存储
a[i] = (a[i] - 97 + n) % 26 + 97;//移动n位
}
for (int k = 0; k <= i - 1; k++)
{
printf("%c", a[k]);//输出密码
}
return 0;
}