#include <iostream>
#include <time.h>
#include <vector>
using namespace std;
void print_array(int* arr, int n) {
for (size_t i = 0; i < n; i++) {
cout << arr[i] << " ";
}
cout << endl;
int* auto_input_array(int* arr, int n) {
arr[i] = rand() % 200 - 100;
return arr;
void print_vector(vector<int> vec) {
for (int elem : vec) {
cout << elem << " ";
int min_in_array(int* arr, int n) {
int min_arr = arr[0];
if (arr[i] <= min_arr) {
min_arr = arr[i];
return min_arr;
vector<int> selection_of_elements_in_the_first_array_at_the_minimum_of_the_second_array(int* arr1, int n, int* arr2, int m) {
int count = 0;
int min_arr2 = min_in_array(arr2, m);
vector<int> vec;
for (size_t i = 0; i < m; i++) {
if (arr2[i] <= min_arr2) {
min_arr2 = arr2[i];
if (arr1[i] >= min_arr2) {
vec.push_back(arr1[i]);
return vec;
int main() {
srand(time(NULL));
setlocale(LC_ALL, "Russian");
int n;
cout << "Введите количество элементов в массиве A: ";
cin >> n;
int m;
cout << "Введите количество элементов в массиве B: ";
cin >> m;
int* array1 = new int[n];
int* array2 = new int[m];
int sum = 0;
array1 = auto_input_array(array1, n);
array2 = auto_input_array(array2, m);
print_array(array1, n);
print_array(array2, m);
vec = selection_of_elements_in_the_first_array_at_the_minimum_of_the_second_array(array1, n, array2, m);
delete[] array1;
delete[] array2;
cout << "Числа, которые больше любого элемента в массиве B: " << endl;
print_vector(vec);
#include <iostream>
#include <time.h>
#include <vector>
using namespace std;
void print_array(int* arr, int n) {
for (size_t i = 0; i < n; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
int* auto_input_array(int* arr, int n) {
for (size_t i = 0; i < n; i++) {
arr[i] = rand() % 200 - 100;
}
return arr;
}
void print_vector(vector<int> vec) {
for (int elem : vec) {
cout << elem << " ";
}
cout << endl;
}
int min_in_array(int* arr, int n) {
int min_arr = arr[0];
for (size_t i = 0; i < n; i++) {
if (arr[i] <= min_arr) {
min_arr = arr[i];
}
}
return min_arr;
}
vector<int> selection_of_elements_in_the_first_array_at_the_minimum_of_the_second_array(int* arr1, int n, int* arr2, int m) {
int count = 0;
int min_arr2 = min_in_array(arr2, m);
vector<int> vec;
for (size_t i = 0; i < m; i++) {
if (arr2[i] <= min_arr2) {
min_arr2 = arr2[i];
}
}
for (size_t i = 0; i < n; i++) {
if (arr1[i] >= min_arr2) {
vec.push_back(arr1[i]);
}
}
return vec;
}
int main() {
srand(time(NULL));
setlocale(LC_ALL, "Russian");
int n;
cout << "Введите количество элементов в массиве A: ";
cin >> n;
int m;
cout << "Введите количество элементов в массиве B: ";
cin >> m;
int* array1 = new int[n];
int* array2 = new int[m];
int sum = 0;
vector<int> vec;
array1 = auto_input_array(array1, n);
array2 = auto_input_array(array2, m);
print_array(array1, n);
print_array(array2, m);
vec = selection_of_elements_in_the_first_array_at_the_minimum_of_the_second_array(array1, n, array2, m);
delete[] array1;
delete[] array2;
cout << "Числа, которые больше любого элемента в массиве B: " << endl;
print_vector(vec);
}