/*
A string is called palindrome if the reverse of the string is 
the same as the original. Here take case into account. 
For example, the following strings are palindromes: 
dad
14541
546645
this is good a doog si siht
Write a program to read a string S (using getline) and to determine if S 
is a palindrome.

*/

#include <iostream>
#include <string>
using namespace std;
int main()
{
	string s, t;
	int i, n;
	cout << "Enter a string: " << endl;
	getline(cin,s);
	// Reverse s and store the reverse in t.
	t = "";
	n = s.size();
	for (i = n - 1; i >= 0; i--)
		t = t + s[i];
	if (s == t)
		cout << s << " is a palindrome." << endl;
	else
		cout << s << " is not a palindrome." << endl;
	return 0;
}
