杭电1048

/*********************************
 *    日期: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;
}

 

 

 

 

 

 

你可能感兴趣的:(杭电)