#include<vector> #include<algorithm> ... using namespace std; vector<int> theVector; theVector.push_back(3); theVector.push_back(0); if (theVector.size() >= 2) { cout « theVector[1] « endl; } for(vector<int>::iterator vi = theVector.begin(); vi != theVector.end(); vi++) { cout « *vi « endl; } sort(theVector.begin(), theVector.end()); for(vector<int>::iterator vi = theVector.begin(); vi != theVector.end(); vi++) { cout « *vi « endl; } |