Hoviet @ 2017-05-19 21:30:50
#include <stdio.h>
#include <stdlib.h>
int main()
{
char a[100],b;
int i,n,c;
scanf("%d",&n);
getchar();
for(i=0;i<=99;i++)
{
scanf("%c",&a[i]);
if(a[i]=='\n')
{
i--;
break;
}
}
c=i;
for(i=0;i<=c;i++)
{
b=a[i]+n;
if(b>'z')b=b-26;
printf("%c",b);
}
return 0;
}
by 固执 @ 2017-05-20 07:35:10
(我不知道我说的对不对……)
我说getchar……
by Kirisame_Marisa_ @ 2017-05-20 22:06:22
@小杨 那个getchar是专门去掉换行符的
by 固执 @ 2017-05-20 22:11:43
@Il_ItsABC_lI awa好吧
by 固执 @ 2017-05-20 22:12:04
@Il_ItsABC_lI 我倒是很少用getchar
by Kirisame_Marisa_ @ 2017-05-20 22:17:32
恶心这题不能用getchar去换行,要2次gets
by zhousirui070502 @ 2017-06-11 15:33:01
getchar的格式我都快忘了……