mset4.cpp

We use cookies. Read the Privacy and Cookie Policy

mset4.cpp

#include ‹iostream.h›

#include ‹stl.h›

int array[] = {3, 6, 1, 2, 3, 2, 6, 7, 9};

int main() {

 typedef multiset‹int, less‹int› › mset;

 mset s(array, array + 9);

 pair‹mset::const_iterator, mset::const_iterator› p = s.equal_range(3);

 cout ‹‹ "lower bound = " ‹‹ *(p.first) ‹‹ endl;

 cout ‹‹ "upper bound = " ‹‹ *(p.second) ‹‹ endl;

 return 0;

}