Function to check if string is Palindrome or Not
bool IsPalindrome ( string & str ) { int n = strlen ( str ) ; for ( int i = 0 ; i < n / 2 ; i ++ ) if ( str [ i ] != str [ n - 1 - i ] ) return false ; return true ; }