现在的位置: 首页 > 综合 > 正文

杭电1048

2013年10月28日 ⁄ 综合 ⁄ 共 916字 ⁄ 字号 评论关闭

/*********************************
 *    日期:2011-3-9
 *    作者:SJF
 *    题号:杭电1048
 *    题目:The Hardest Problem Ever
 *    结果:AC
 *    总结:
**********************************/
#include<stdio.h>
int main()
{
    int N,len,i;
    char Cipher[201],*Plain="VWXYZABCDEFGHIJKLMNOPQRSTU";
    while(gets(Cipher)!=EOF)
    {
        len=strlen(Cipher);
        Cipher[len]='\0';
        if(strcmp(Cipher,"START")==0)
        {
            continue;
        }
        else if(strcmp(Cipher,"END")==0)
        {
            continue;
        }
        else if(strcmp(Cipher,"ENDOFINPUT")==0)
        {
            break;
        }
        else
        {
            for(i=0;i<len;i++)
            {
                if(Cipher[i]>=65&&Cipher[i]<=90)
                {
                    printf("%c",Plain[Cipher[i]-'A']);
                }
                else
                {
                    printf("%c",Cipher[i]);
                }
            }
            printf("\n");
        }       
    }
    return 0;
}

 

 

 

 

 

 

抱歉!评论已关闭.