This commit is contained in:
Andrew 2019-11-18 10:01:42 +07:00
commit 2802401eee
79 changed files with 2650 additions and 0 deletions

View file

@ -0,0 +1,40 @@
// ac_8_26.cpp
// Горбацевич Андрей
#include <iostream>
#include <vector>
using namespace std;
vector<int> count_less(const vector<int> &vec, int h) {
vector<int> v;
v.reserve(vec.size());
for (size_t c = 0; c < vec.size(); c++) {
if (vec[c] < h) {
v.push_back(c);
}
}
return v;
}
int main() {
int N;
cout << "N >>>";
cin >> N;
vector<int> heights;
heights.reserve(N);
cout << "heights[...] >>>";
for (int i = 0; i < N; i++) {
int j;
cin >> j;
heights.push_back(j);
}
int h;
cout << "h >>>";
cin >> h;
vector<int> nv = count_less(heights, h);
cout << "Lesser indexes: ";
for (int ch : nv) {
cout << ch << " ";
}
cout << endl;
return 0;
}