【杭电】[1048]The Hardest Problem Ever

文章字数:92

问题描述

问题分析

题目有点长……
但思路还是挺简单的
不说什么了……

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<stdio.h>
#include<string.h>
int main() {
	char s[120];
	int i;
	while(gets(s)) {
		if(!strcmp(s,"ENDOFINPUT"))
			break;
		else if(!strcmp(s,"START"))
			continue;
		else if(!strcmp(s,"END"))
			continue;
		else {
			for(i=0; i<strlen(s); i++) {
				if(s[i]<='Z'&&s[i]>='F')
					s[i]-=5;
				else if(s[i]>='A'&&s[i]<='E')
					s[i]+=21;
			}
			printf("%s\n",s);
		}
	}
	return 0;
}

该内容采用 CC BY-NC-SA 4.0 许可协议。

如果对您有帮助或存在意见建议,欢迎在下方评论交流。

加载中...