#include #include #include #include #include #include using namespace std; //myAlgo_search_n1.cpp int filter(int, int); int main() { int n1[10] = { 69 ,75,63,64,65,64,64,68,64,71 }; vectorv1(n1, n1+10); vector::iterator it; ostream_iterator< int > output( cout, " " ); cout<<" original array v1 \n\t \b "; copy(v1.begin(),v1.end(), output); it = search_n(v1.begin(),v1.end(), 1, 64); if(it == v1.end()) { cout <<"\n no matched "; } else { cout <<"\n matched at "<< it - v1.begin(); } // it = search_n(v1.begin(),v1.end(), 2, 64); if(it == v1.end()) { cout <<"\n matched at "<< it - v1.begin(); } else { cout <<"\n matched at "<< it - v1.begin(); } return 0; }