#include #include #include //For greater( ) #include #include #include using namespace std; //myAlgo_lowerbound1.cpp void find_lowerbound(int); int n1[] = { 69 ,60,63,61,65,64,71,70,68,64 }; vectorv1; int main () { // ostream_iterator< int > output( cout, " " ); vectorv1(n1, n1+10), v2; vector::iterator it; copy(v1.begin(),v1.end(), output); cout<<"\n The report below shows that " ; cout<<"\n the value is lower than the current "; cout<<"\n can be inserted at "; for(it=v1.begin(); it !=v1.end(); it++) { find_lowerbound(*it); } return 0; } void find_lowerbound(int value) { cout<<"\n lower bound of "<< value << " is at "; // vectorv1(n1, n1+10); vector< int >::iterator it; it = lower_bound( v1.begin(), v1.end(), value ); cout<< " :" << int( it - v1.begin() ); }