#include <string>
#include <cctype>
#include <algorithm>
#include <iostream>

bool is_palindrome( const std::string& str )
{
    std::string s ;
    for( char c : str ) if( std::isalpha(c) ) s += std::toupper(c) ;
    return !s.empty() && std::equal( s.begin(), s.begin() + s.size()/2, s.rbegin() ) ;
}

int main()
{
    const char* const phrases[]
    {
        "A man, a plan, a canal - Panama!", // yes
        "not palindrome", // no
        "No lemon, no melon", // yes
        "Not lemon, not melon", // almost, but no
        "Never odd or even" // yes
    };
    for( auto cstr : phrases ) if( is_palindrome(cstr) ) std::cout << cstr << '\n' ;
}
