_zbs666 @ 2023-11-22 21:26:32
#include<stdio.h>
#include<string.h>
int main()
{
int n;
scanf("%d",&n);
getchar();
if(n>=26)
{
while(1)
{
if(n<26)
break;
n=n-26;
}
}
char str[51];
gets(str);
int i,k;
k= strlen(str);
for(i=0; i<k; i++)
{
if ((str[i]+n)>'z')
{
str[i]=str[i]+n-26;
}
else if((str[i]+n)>='a'&&(str[i]+n)<='z')
{
str[i]=str[i]+n;
}
}
for(i=0; i<k; i++)
{
printf("%c",str[i]);
}
return 0;
}
by dontlov @ 2023-11-29 16:34:03
get在这不能用,只适用于noi
by _zbs666 @ 2023-11-30 15:03:58
@dontlov
大佬,是不能用gets吗?
by dontlov @ 2023-12-05 16:06:53
@_zbs666 是的