Advertisement
oleg_drawer

Untitled

Apr 24th, 2020
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4.  
  5.  
  6. int main() {
  7.     set<int>s;
  8.     s.insert(1);
  9.     s.insert(3);
  10.     s.insert(4);
  11.     s.insert(7);
  12.     auto it = s.upper_bound(3);
  13.     cout << *it << endl; // выводит 4
  14.     it--;
  15.     cout << *it << endl; // выводит 3
  16.    
  17.    
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement