Advertisement
irapilguy

Untitled

Nov 14th, 2020
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <set>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n;
  9.     while (cin >> n)
  10.     {
  11.         vector<int> v;
  12.         int x;
  13.         for (int i = 0; i < n; i++)
  14.         {
  15.             cin >> x;
  16.             v.push_back(x);
  17.         }
  18.         int a, b;
  19.         cin >> a >> b;
  20.         int cnt = 0;
  21.         for (auto el : v)
  22.         {
  23.             if (el >= a && el <= b)
  24.             {
  25.                 cnt++;
  26.             }
  27.         }
  28.  
  29.         cout << cnt << "\n";
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement