#include <iostream>
#include <algorithm>
#include <vector>
int main()
{
std::vector<int> v = { 12, 3, 5, 7, 9, 2, 6, 8, 99, 1, 0 };
int first_4 = 4;
partial_sort(v.begin(), v.begin() + first_4, v.end());
for(auto const& n : v)
std::cout << n << " ";
return 0;
}
/*
run:
0 1 2 3 12 9 7 8 99 6 5
*/