Tju : 1539


// @BEGIN_OF_SOURCE_CODE

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <sstream>
#include <set>
#include <math.h>
#define N 1000000
using namespace std;


int main ()
{
    char input [100];

    while ( gets (input) ) {
        if ( strcmp (input, "THE END.") == 0 )
            break;

        string str;

        for ( int i = 0; input [i]; i++ ) {
            if ( isalpha (input [i]) )
                str += tolower (input [i]);
        }

        string copy = str;
        reverse (copy.begin (), copy.end ());

        if ( str == copy )
            printf ("Yes\n");
        else
            printf ("No\n");
    }

    return 0;
}

// @END_OF_SOURCE_CODE

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s