#include <iostream>
#include <ctime>
using namespace std;
int main()
{
setlocale(LC_CTYPE, "Rus");
srand(time(0));
int n,min=RAND_MAX,nl=0, j = 0;
cout << "Размер массива: "; cin >> n;
int *a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = rand() % 10;
cout << a[i] << ' ';
if ((a[i] < min)&&((i+1)%2!=0)) min = a[i];
}
for (int i = 0; i < n; i++) if (a[i] == min) nl++;
cout << endl;
while (j < n-nl)
if (a[j] == min)
for (int i = j; i < n - 1; i++) swap(a[i], a[i + 1]);
else j++;
for (int i = 0; i < n - nl; i++) cout << a[i] << ' ';
system("pause");
return 0;
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
setlocale(LC_CTYPE, "Rus");
srand(time(0));
int n,min=RAND_MAX,nl=0, j = 0;
cout << "Размер массива: "; cin >> n;
int *a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = rand() % 10;
cout << a[i] << ' ';
if ((a[i] < min)&&((i+1)%2!=0)) min = a[i];
}
for (int i = 0; i < n; i++) if (a[i] == min) nl++;
cout << endl;
while (j < n-nl)
if (a[j] == min)
for (int i = j; i < n - 1; i++) swap(a[i], a[i + 1]);
else j++;
for (int i = 0; i < n - nl; i++) cout << a[i] << ' ';
cout << endl;
system("pause");
return 0;
}