poj 1298 The Hardest Problem Ever

题目来源:http://poj.org/problem?id=1298

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <climits>
#include <cctype>

using namespace std;


int main()
{
    string str;
    int i;
    while( cin>>str )
    {
        cin.ignore(INT_MAX, '\n');
        if(str == "ENDOFINPUT")
            break ;
        getline(cin, str, '\n');
        for(i = 0; i < str.length(); ++i)
            if(isalpha(str[i]))
                str[i] = 'A' + (str[i] - 'A' + 21) % 26;
        cout<<str<<endl;
        cin>>str;
    }
    return 0;
}


你可能感兴趣的:(模拟,poj)