#include <algorithm>
#include <iostream>

int main()
{
    const int heightCount = 8;
    int kidHeights[heightCount] = { 1, 3, 6, 5, 6, 4, 2, 3 };

    // your first for loop
    auto maxHeightIter = std::max_element(kidHeights, kidHeights + heightCount);

    // your second for loop
    auto maxHeightCount = std::count(kidHeights, kidHeights + heightCount, *maxHeightIter);

    std::cout
        << "Highest kid is " << *maxHeightIter
        << " unit(s) high and number " << maxHeightIter - kidHeights + 1
        << " in line.\nThere are " << maxHeightCount
        << " kids with this height, in total." << std::endl;
}