void sepateArrToObbs1(const int array[],int size,int &odds,int &numbleOdds,int &evens,int &numevens)
{
int oddsPos = 0,evensPos = 0;
for(int i = 0;i < size;++i)
{
if(array[i] % 2 == 1)
{
numbleOdds++;
}else
{
numevens++;
}
}
odds = new int[numbleOdds];
evens = new int[numevens];
for(int i = 0;i < size;++i)
{
if(array[i] % 2 == 1)
{
odds[oddsPos] = array[i];
oddsPos++;
}else
{
evens[evensPos] = array[i];
evensPos++;
}
}
}
int man()
{
int array[10];
for(int i = 0;i < 10;++i)
{
array[i] = i+1;
}
int odds,evens;
int numbleOdds,numevens;
sepateArrToObbs1(array,10,odds,numbleOdds,evens,numevens);
std::cout << "numbleOdds : " << numbleOdds << " " << "numevens : " <<
numevens << std::endl;
std::cout << "odds : "<< std::endl;
for(int i = 0;i < numbleOdds;++i)
{
std::cout << odds[i] << std::endl;
}
std::cout << "evens : "<< std::endl;
for(int j = 0;j < numevens;++j)
{
std::cout << evens[j] << std::endl;
}
std::cout << std::endl;
}