copy函数:copy(&a,&b,&c)把a到b的内容复制到C
#include<iostream>
#include<vector>
#include<algorithm>
#include<fstream>
#include<iterator>
using namespace std;
int main()
{
vector<int> vi;
int temp;
/*while(cin>>temp)
vi.push_back(temp);*/
copy(istream_iterator<int>(cin),
istream_iterator<int>(),
back_inserter(vi) );
sort(vi.begin(), vi.end());
copy(vi.begin(), vi.end(), ostream_iterator<int>(cout, "\t"));
cout<<endl;
return 0;
}