fork(60) download
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4.  
  5. int main() {
  6. set<int> a;
  7. a.insert(1);
  8. a.insert(5);
  9. a.insert(6);
  10. set<int>::iterator it = a.lower_bound(5);
  11. if (it != a.begin()) {
  12. it--;
  13. cout << *it << endl;
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1