胡萝卜兔 @ 2019-11-07 16:49:44
#include <stdio.h>
int main()
{
int n,i,j;
char ch[51],a;
scanf("%d",&n);
scanf("%c",&a);//存储为了换行输入的回车//
for(i=0;;i=i+1)
{
scanf("%c",&ch[i]);
if(ch[i]=='\n') break;
ch[i]=ch[i]-96+n;//将ASCII码转到1~26后再移动//
ch[i]=ch[i]%26+96;//取余后+96回到正确的ASCII码//
}
for(j=0;j<=i-1;j=j+1)
printf("%c",ch[j]);
return 0;
}
by 辰星凌 @ 2019-11-07 16:54:42
字符串读入有锅
by 辰星凌 @ 2019-11-07 16:55:05
如果搞不清楚就用cin啊啊啊啊啊
by TokyoFreshAir @ 2019-11-07 17:01:27
刚学没多久最好字符串老老实实用cin
by hjxhjx @ 2019-11-07 17:14:35
关于scanf
他死了
by Pinoochio @ 2020-03-28 17:47:13
搞不清楚就用cin啊啊啊啊啊啊啊