#include
using std::vector;
#include
using std::random_shuffle;
int main() {
vector vi;
const int MAX = 100;
const int WIDTH = 20;
for (int i = 0; i < MAX; i++)
vi.push_back(i);
// Now the vector contains MAX elements:
// 0-99 stored in an ascending order
for (int i = 0; i < MAX; i++) {
cout << vi[i] << ' ';
if ( i % WIDTH == WIDTH - 1 ) cout << '\n';
}
cout << endl;
random_shuffle(vi.begin(), vi.end()); /* shuffle elements */
// display shuffled elements
for (int i = 0; i < MAX; i++) {
cout << vi[i] << ' ';
if ( i%WIDTH == WIDTH-1 ) cout << '\n';
}
cout << endl;
}