random_shuffle(). Nice.
If you didn't want to destroy your vector with the 295 numbers, you could modify the program slightly:
Code:
#include <iostream>
#include <vector>
#include <algorithm> // for random_shuffle
using namespace std;
int main()
{
vector<int> randoms(295);
/* Generate a vector containing the numbers 0..294 */
for (vector<int>::size_type i = 0; i < randoms.size(); i++)
randoms[i] = i;
/* Shuffle */
random_shuffle(randoms.begin(), randoms.end());
/* Keep only the first 90 numbers */
// randoms.resize(90);
vector<int> ninety(90);
vector<int>::iterator begin = randoms.begin();
copy(begin, begin + 90, ninety.begin()); //(beginning of range, end of range, destination)
//output the numbers to the screen:
copy(ninety.begin(), ninety.end(), ostream_iterator<int>(cout, "\n"));
return 0;
}