#include <iostream>
using namespace std;
int main()
{
setlocale (LC_ALL, "Russian");
int n, i, j, temp;
std::cout<<"Введите количество элементов: ", std::cin>>n;
int *mas1 = new int[n];
int *mas2 = new int[n];
int **mas = new int*[2];
mas[0] = new int[n];
mas[1] = new int[n];
std::cout<<"Введите первый массив:\n";
for(i = 0; i < n; ++i)
std::cin>>mas1[i];
std::cout<<"Введите второй массив:\n";
for(i = 0; i < n; ++i)
std::cin>>mas2[i];
for (i = 1; i < n; i++)
{
temp = mas1[i];
for (j = i - 1; j >= 0; j--)
{
if (mas1[j] > temp)
break;
mas1[j+1] = mas1[j];
}
mas1[j+1] = temp;
}
for (i = 1; i < n; i++)
{
temp = mas2[i];
for (j = i - 1; j >= 0; j--)
{
if (mas2[j] < temp)
break;
mas2[j+1] = mas2[j];
}
mas2[j+1] = temp;
}
for(i = 0; i < n; ++i)
{
mas[0][i] = mas2[i];
mas[1][i] = mas1[i];
}
std::cout<<"Результат:\n";
for(i = 0; i < 2; ++i, std::cout<<'\n')
for(j = 0; j < n; ++j)
std::cout<<mas[i][j]<<' ';
system("pause");
return 0;
}
Nice post. I learn something totally new and challenging on blogs I stumbleupon on a daily basis. Its always helpful to read articles from other writers and practice a little something from their websites.
https://empress-escort.com/escort-girls-beer-sheva/