собственно код int left, right; bool direction; left = 0; right = 9; direction = true; while(left!=right) { if(direction) { if(a[right]<0) { swap(a[left],a[right]); left++; direction = false; } } else { if(a[left]>=0) { swap(a[left],a[right]); right++; direction = true; } } } if(a[left]<0)left++; if((left==0)||(left==10)) nomad_huita(left); b = a; c = b + left;