#include <iostream>
#include <vector>
void printVector(std::vector<int> const &v) {
for (auto const &n: v) {
std::cout << n << " ";
}
}
int main ()
{
std::vector<int> v = { 5, 2, 7, 1, 9, 3 };
v.erase(prev(v.end()));
printVector(v);
return 0;
}
/*
run:
5 2 7 1 9
*/