Counting words in files - follow-up-3
Overall, this looks pretty nice. There are few minor things that can be improved though, about this part:


int x = 0;

for (const auto&amp; i : words)
{
    if (x++ == 0)
    {
        std::cout &lt;&lt; "\nThe most repeated element is: " &lt;&lt; i-&gt;first &lt;&lt; "\n\n";

        std::cout &lt;&lt; " Word\tRepeated Times";

        std::cout &lt;&lt; '\n' &lt;&lt; std::setfill('-') &lt;&lt; std::setw(23) &lt;&lt; '\n';
    }

    // ...
}



i is customary for loop variables that are simple counters.
In this case it is a word (well, sort of), 
so it would be better to name it as such.

The variable x is a bit confusing:


its name tells nothing of its purpose
it's important for the first iteration of the loop
... but it keeps counting during all iterations


It would be clearer and better this way:

bool first = true;

for (const auto&amp; word : words)
{
    if (first)
    {
        std::cout &lt;&lt; "\nThe most repeated element is: " &lt;&lt; word-&gt;first &lt;&lt; "\n\n";

        std::cout &lt;&lt; " Word\tRepeated Times";

        std::cout &lt;&lt; '\n' &lt;&lt; std::setfill('-') &lt;&lt; std::setw(23) &lt;&lt; '\n';

        first = false;
    }

    // ...
}