#include "stdafx.h"
#include "iostream"
#include "time.h"
#include "math.h"

using namespace std;

int main()
{
setlocale(LC_ALL, "Russian");
int i;
int n;
cout << "Введите количесвто элементов: ";
cin >> n;
cout << endl;
int *mas = new int [n];

srand(time(NULL));
for (i=0; i<n; i++)
{
mas[i]=rand()%20-10;
cout << " " << mas[i];
}
cout << "\r\n";
cout << "\r\n";
cout << "Преобразованный массив:" << endl;
cout << "\r\n";
for(i=0; i<n; i++)
{
if (mas[i]%2 == 0)
{
cout << mas[i] << " ";
}
}
for(i=0; i<n; i++)
{
if (mas[i]%2)
{
cout << mas[i] << " ";
}
}
cout << endl << endl;
system("PAUSE");
return 0;
}