fork 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(4);
  9. a.insert(10);
  10. a.insert(15);
  11. set<int>::iterator it = a.lower_bound(0);
  12. if (it != a.begin()) {
  13. it--;
  14. cout << *it << endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
Standard output is empty