In the following listing I have used cin.get() to keep the console window open when I run the .exe file - it has worked before for me but in this program it doesn't - the console shuts immediately after outputting the list - I just know this is going to be something obvious so sorry in advance!!
using namespace std;
vector<int> data; // initialized to be empty
// Read integers one at a time.
while (cin >> x)
// Store each integer in the vector.
// Sort the vector.
// Print the vector, one number per line.
for (vector<int>::size_type i(0); i != data.size(); i = i + 1)
cout << data.at(i) << '\n';