小纸条

发布时间 2023-07-18 16:18:05作者: EricFirst001

小纸条

小鑫の日常系列故事(七)——小纸条 | SDUT

#include <stdio.h>
#include <string.h>
int main()
{
	int n;
	char ch[10000];
	while(scanf("%d",&n)!=EOF){//输入向后移的位数
		getchar();//scanf的终止是一个回车符
		gets(ch);
		for(int i=0;i<strlen(ch);i++){
			if(ch[i]==' '){continue;//跳过空格 
             }
			else
			{
                ch[i]=ch[i]-n;//进行循环向后移动
             }	
		}
		for(int i=0;i<strlen(ch);i++){
			printf("%c",ch[i]);
		}
		printf("\n");
	}
	return 0;
}