#include<stdlib.h>
#include<time.h>
#include<vector>
#include<algorithm>
#include<iostream>
std::vector<int> vectRandomInts;
srand( (unsigned)time( NULL ) );
for(int i=0; i<50; ++i)
vectRandomInts.push_back(abs(rand())%42);
std::vector<int>::const_iterator beg = vectRandomInts.begin();
std::vector<int>::const_iterator end = vectRandomInts.end();
if( end != std::find(beg, end, 13) )
std::cout << 13 << " found\n";
else
std::cout << 13 << " not found\n";
End of Listing