str = str[0].toUpperCase() + str.slice(1);
// или
str = str.replace(/^./, m => m.toUpperCase());
// или
str = Array.from(str, (n, i) => i ? n : n.toUpperCase()).join('');
std::vector<int> Counter;
for (int i = 0; i <= n; i++)
{
Counter.push_back(i);
}
std::map<int, int> Counter;
for (int i = 0; i <= n; i++)
{
Counter[i] = i;
}