fork download
  1. #include <set>
  2. #include <iostream>
  3. #include <cstdlib>
  4. #include <functional>
  5. using namespace std;
  6. int main()
  7. {
  8. set<int,std::greater<int> > a;
  9. const int n=10;
  10. for (int i = 0; i < n; i++)
  11. a.insert(rand() % 11);
  12. set<int>::iterator itb=a.begin();
  13. set<int>::iterator ite=a.end();
  14. for (;itb!=ite; ++itb)
  15. cout << *itb << " ";
  16. system("pause");
  17. return 0;
  18. }
Success #stdin #stdout #stderr 0s 3472KB
stdin
Standard input is empty
stdout
10 6 4 3 2 1 0 
stderr
sh: pause: not found