Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main() {
- set<int>s;
- s.insert(1);
- s.insert(3);
- s.insert(4);
- s.insert(7);
- auto it = s.upper_bound(3);
- cout << *it << endl; // выводит 4
- it--;
- cout << *it << endl; // выводит 3
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement