fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. set<int> s;
  6. // for (int i = 0; i < 10; ++i) {
  7. // s.insert(2 * i);
  8. // cout << 2 * i << ' ';
  9. // }
  10. // cout << endl;
  11. vector<int> v;
  12. v.push_back(2);
  13. v.push_back(3);
  14. v.push_back(7);
  15.  
  16. for (int i = 0; i < v.size(); ++i) {
  17. s.insert(v[i]);
  18. }
  19.  
  20. set<int>::iterator it;
  21.  
  22. it = s.lower_bound(5);
  23. cout << *it;
  24.  
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
7