#includeIn this example, we are using std::back_inserter to add elements to the vector from standard input. The function std::copy_n copies 5 elements from standard input to the vector using the std::back_inserter. Package library: Standard Template Library (STL) Example 2: Adding key-value pairs to a map using std::inserter ``` #include#include #include #include int main() { std::vector v; std::copy_n(std::istream_iterator (std::cin), 5, std::back_inserter(v)); // Adds 5 elements to the vector for (const auto& num : v) { std::cout << num << ' '; } return 0; }