srand(time(0));
const int size_a = 10;
const int size_b = 5;
const int size_c = size_a + size_b;
int A[size_a]{};
int B[size_b]{};
int C[size_c]{};
for (size_t i = 0; i < size_a; i++)
{
cout << endl;
for (size_t i = 0; i < size_b; i++)
{
cout << endl;
int index_a = 0;
int index_b = 0;
for (size_t i = 0; i < size_c;)
{
}
for (size_t i = 0; i < size_c; i++)
{
cout << endl;
system("pause");
const int size_a = 10;
const int size_b = 5;
const int size_c = size_a + size_b;
int A[size_a]{};
int B[size_b]{};
int C[size_c]{};
for (size_t i = 0; i < size_a; i++)
{
A[i] = rand() % 101;}
cout << A[i] << " ";
cout << endl;
for (size_t i = 0; i < size_b; i++)
{
B[i] = rand() % 101;}
cout << B[i] << " ";
cout << endl;
int index_a = 0;
int index_b = 0;
for (size_t i = 0; i < size_c;)
{
if (index_a < size_a)
{
C[i] = A[index_a];}
index_a++;
i++;
if (index_b < size_b)
{
C[i] = B[index_b];}
index_b++;
i++;
}
for (size_t i = 0; i < size_c; i++)
{
cout << C[i] << " ";}
cout << endl;
system("pause");
Комментариев нет:
Отправить комментарий