#include #include #include #include // for time #include // for srand using namespace std; int main(int argc, char** argv) { vector v; srand(time(0)); // initialize random number generator for (int i = 0; i < 30; i++) { v.push_back(i); } for (auto& n : v) { cout << n << " "; } cout << endl; random_shuffle(v.begin(), v.end()); for (auto& n : v) { cout << n << " "; } cout << endl; sort(v.begin() + 5, v.end() - 5); for (auto& n : v) { cout << n << " "; } cout << endl; }