if (n=='y' || n=='j'|| n=='d')
if( std::strchr( "yjd", n ) ) // http://en.cppreference.com/w/cpp/string/byte/strchr
if( n && std::strchr( "yjd", n ) )