#include <stdio.h>#include <malloc.h>void func(int *mas, int N){ int l=0, r=N-1, i; while(l<r) { for(i=l; i<N; i++) if(mas[i]<0) break; l=i; for(i=r; i>=0; i--) if(mas[i]>=0) break; r=i; if(l<r) { int temp=mas[l]; mas[l]=mas[r]; mas[r]=temp; } }} int main() {int *mas, N, i;printf("N= ");scanf("%d", &N);mas=(int*) malloc(N*sizeof(int));for(i=0; i<N; i++){ printf("[%d]= ", i); scanf("%d", &mas[i]);}func(mas, N);for(i=0; i<N; i++) printf("%d ", mas[i]); return 0;}