- //文件名:CHAPTER4-3.cpp
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <iterator>
- #include <stdlib.h>
- #include <stdio.h>
- #include <functional>
- using namespace std;
- main (int argc, char *argv[])
- {
- vector<int> a(100); // initial size 100
- random_shuffle (a.begin(), a.end()); // shuffle
- copy (a.begin(), a.end(), ostream_iterator<int> (cout, "n")); // print
- }