Advertisement
Josif_tepe

Untitled

Dec 2nd, 2022
703
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.    
  11.     int niza[n];
  12.     for(int i = 0; i < n; i++) {
  13.         cin >> niza[i];
  14.     }
  15.     int x;
  16.     cin >> x;
  17.     sort(niza, niza + n);
  18.    
  19.     int pozicija = lower_bound(niza, niza + n, x) - niza;
  20.    
  21.     cout << pozicija + 1 << endl;
  22.    return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement