#include <iostream>
#include <algorithm>

inline bool yes_counter( char ch )
{
    return ch == 'Y' || ch == 'y';
}

int main()
{
    int const & counter = 10;
    int yc = 0, nc = 0;
    std::string votes {};

    std::cout << "Enter a string of Yes and No votes: ";
    std::getline( std::cin, votes );
    votes.resize( counter ); //make sure input is exactly 10.

    yc = std::count_if( votes.cbegin(), votes.cend(), yes_counter );
    nc = std::count_if( votes.cbegin(), votes.cend(), []( char ch ) { return ch == 'N' || ch == 'n'; } );

    std::cout << "Yes votes amount to " << yc << ", and No votes amount to " << nc << std::endl;
    std::cout << "\tNumbers of Yes votes: " << std::string ( yc, '*' ) << std::endl;
    std::cout << "\tNumbers of No votes: " << std::string ( nc, '*' ) << std::endl;
    return 0;
}