fork(2) download
  1. //Run Code To Demonstrate use of set.lower_bound(x)
  2. #include<iostream>
  3. #include<set>
  4.  
  5. int main(){
  6. // Create a set object holding integers
  7. std::set<int> mySet {1,2,4,-5,6};
  8.  
  9. std::cout << "The lower_bound of 4 is: " << *(mySet.lower_bound(4)) << std::endl;
  10.  
  11. std::cout << "The lower_bound of 5 is: " << *(mySet.lower_bound(5)) << std::endl;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 4412KB
stdin
Standard input is empty
stdout
The lower_bound of 4 is: 4
The lower_bound of 5 is: 6