fork(2) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5.  
  6. int arr[] = { 14, 12, 15, 11, 10 };
  7.  
  8. // initializes the set from an array
  9. set<int> s(arr, arr + 5);
  10.  
  11. set<int>::reverse_iterator rit;
  12.  
  13. // prints all elements in reverse order
  14. std::cout << *(s.rbegin()) <<std::endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 4360KB
stdin
Standard input is empty
stdout
15