mapple @ 2022-12-23 10:07:03
#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
getchar();
char a[100];
gets(a);
for(i=0;a[i]!='\0';i++)
{
a[i]=(a[i]-'a'+n)%26+'a';
printf("%c",a[i]);
}
return 0;
}
by HYliumingxuan @ 2022-12-23 10:16:19
不要使用gets
by HYliumingxuan @ 2022-12-23 10:17:45
可以用洛谷的在线IDE检查是否有编译器的不同导致的出错
by donnieguo @ 2022-12-23 11:12:31
对,不要用gets
by mapple @ 2022-12-24 10:05:18
@HYliumingxuan 谢谢啦