srand(time(0));
const int size = 10;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
cout << endl;
for (size_t i = 0; i < size; i+=2)
{
for (size_t i = 0; i < size; i++)
{
cout << endl;
system("pause");
const int size = 10;
int A[size]{};
for (size_t i = 0; i < size; i++)
{
A[i] = rand() % 101;}
cout << A[i] << " ";
cout << endl;
for (size_t i = 0; i < size; i+=2)
{
A[i] += A[i+1];}
A[i + 1] = A[i] - A[i + 1];
A[i] = A[i] - A[i + 1];
for (size_t i = 0; i < size; i++)
{
cout << A[i] << " ";}
cout << endl;
system("pause");
Комментариев нет:
Отправить комментарий