#include "stdafx.h" //勾选了预编译头
#include <iostream>
#include <algorithm>
#include <vector>using namespace std;

void Display(vector<int> &v,const char *s);

int _tmain(int argc, _TCHAR* argv[])
{
vector<int>collection(10);
for(int i=0;i<10;i++)
collection[i]=rand()%10000; Display(collection,"Before sorting");
sort(collection.begin(),collection.end());


Display(collection,"After sorting");
getchar();
return 0;
} void Display(vector<int> &v,const char *s)
{
cout <<endl<<s<<endl;
for(int i=0;i<10;i++)
cout<<v[i]<<" ";}