POJ 1298


#include <cstdio>

#include <cstring>

#include <cctype>

#include <cstdlib>

using namespace std;

char str[210];

int main()

{

    int i,j,k,T;

    char str0[10];

    while(scanf("%s",str0),strcmp(str0,"ENDOFINPUT"))

    {

        getchar();

        memset(str0,0,sizeof(str0));

        memset(str,0,sizeof(str));

        while(gets(str),strcmp(str,"END"))

        {

            for(i=0;str[i]!='\0';i++)

            {

                if(isalpha(str[i]))

                {

                    int temp=(int)str[i]-5;

                    printf("%c",temp>64?temp:temp+26);

                }

                else

                    printf("%c",str[i]);

            }

            putchar('\n');//必须的,否则end不会显示PE 

            memset(str,0,sizeof(str));

        }

    }

    system("pause");

    return 0;

}

                    

                    

 

你可能感兴趣的:(poj)