#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);
Основание = 18
25₁₈ = 5*18⁰ + 2*18¹ = 41₁₀
Объяснение:
25₆ = 5*6⁰ + 2*6¹ = 17₁₀
25₇ = 5*7⁰ + 2*7¹ = 19₁₀
25₈ = 5*8⁰ + 2*8¹ = 21₁₀
25₉ = 5*9⁰ + 2*9¹ = 23₁₀
25₁₁ = 5*11⁰ + 2*11¹ = 27₁₀
25₁₂ = 5*12⁰ + 2*12¹ = 29₁₀
25₁₃ = 5*13⁰ + 2*13¹ = 31₁₀
25₁₄ = 5*14⁰ + 2*14¹ = 33₁₀
25₁₆ = 5*16⁰ + 2*16¹ = 37₁₀
25₁₇ = 5*17⁰ + 2*17¹ = 39₁₀
25₁₉ = 5*19⁰ + 2*19¹ = 43₁₀
25₂₀ = 5*20⁰ + 2*20¹ = 45₁₀
25₂₁ = 5*21⁰ + 2*21¹ = 47₁₀
25₂₂ = 5*22⁰ + 2*22¹ = 49₁₀
25₂₃ = 5*23⁰ + 2*23¹ = 51₁₀
25₂₄ = 5*24⁰ + 2*24¹ = 53₁₀
25₂₅ = 5*25⁰ + 2*25¹ = 55₁₀
#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);
}
Основание = 18
25₁₈ = 5*18⁰ + 2*18¹ = 41₁₀
Объяснение:
25₆ = 5*6⁰ + 2*6¹ = 17₁₀
25₇ = 5*7⁰ + 2*7¹ = 19₁₀
25₈ = 5*8⁰ + 2*8¹ = 21₁₀
25₉ = 5*9⁰ + 2*9¹ = 23₁₀
25₁₁ = 5*11⁰ + 2*11¹ = 27₁₀
25₁₂ = 5*12⁰ + 2*12¹ = 29₁₀
25₁₃ = 5*13⁰ + 2*13¹ = 31₁₀
25₁₄ = 5*14⁰ + 2*14¹ = 33₁₀
25₁₆ = 5*16⁰ + 2*16¹ = 37₁₀
25₁₇ = 5*17⁰ + 2*17¹ = 39₁₀
25₁₈ = 5*18⁰ + 2*18¹ = 41₁₀
25₁₉ = 5*19⁰ + 2*19¹ = 43₁₀
25₂₀ = 5*20⁰ + 2*20¹ = 45₁₀
25₂₁ = 5*21⁰ + 2*21¹ = 47₁₀
25₂₂ = 5*22⁰ + 2*22¹ = 49₁₀
25₂₃ = 5*23⁰ + 2*23¹ = 51₁₀
25₂₄ = 5*24⁰ + 2*24¹ = 53₁₀
25₂₅ = 5*25⁰ + 2*25¹ = 55₁₀