Untitled

mail@pastecode.io avatar
unknown
c_cpp
5 days ago
338 B
1
Indexable
Never
int countDigit3( const std::vector< int >& vec )
{
    int result = 0;

    for( const auto& e : vec )
    {
        std::string text = std::to_string( e );
        for( const auto& t : text )
        {
            if( t == '3' )
            {
                ++result;
            }
        }
    }

    return result;
}
Leave a Comment