【杭电】[1048]The Hardest Problem Ever

这里写图片描述
这里写图片描述
这里写图片描述

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

#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;
}

题目地址:【杭电】[1048]The Hardest Problem Ever

posted @ 2015-12-21 19:25  BoilTask  阅读(9)  评论(0编辑  收藏  举报