Advertisement
Salman_CUET_18

bound

Sep 2nd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(void)
  4. {
  5.     int ara[] = {1, 3, 5 ,5, 7};
  6.     auto ptr = lower_bound(ara, ara+5, 5);
  7.     cout << *ptr << " " << ptr - ara << endl;
  8.     auto qtr = upper_bound(ara, ara+5, 5);
  9.     cout << *qtr << " " << qtr - ara << endl;
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement