1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
// multiset::rbegin/rend
#include <iostream>
#include <set>
int main ()
{
int myints[] = {77,16,2,30,30};
std::multiset<int> mymultiset (myints,myints+5);
std::cout << "mymultiset contains:";
for (std::multiset<int>::reverse_iterator rit=mymultiset.rbegin() ; rit!=mymultiset.rend(); ++rit)
std::cout << ' ' << *rit;
std::cout << '\n';
return 0;
}
|