poj1298

简单题

View Code
#include <iostream>

#include <cstdio>

#include <cstdlib>

#include <cstring>

using namespace std;



#define maxl 300



char decipher(char a)

{

    if (!isupper(a))

        return a;

    return (a - 'A' + (26 - 5)) % 26 + 'A';

}



int main()

{

    //freopen("t.txt", "r", stdin);

    while (1)

    {

        char st[maxl];

        gets(st);

        if (st[0] == 'E')

            break;

        gets(st);

        int len = strlen(st);

        for (int i = 0; i < len; i++)

            putchar(decipher(st[i]));

        putchar('\n');

        gets(st);

    }

}

 

你可能感兴趣的:(poj)