#include <stdio.h>
#include <conio.h>
#include <math.h>
int main()
{
int a[100], b[100];
int i , n, j, c1, c2;
int temp;
printf("Nhap so phan tu n=");
scanf("%d",&n);
c1 = 0; c2 = 0;
for (i=0; i < n; i++)
{
printf("\nNhap A[%d]: ", i);
scanf("%d", &temp);
if(temp > 0)
{
b[c2] = temp;
c2++;
}
else
{
a[c1] = temp;
c1++;
}
}
for (i = 0; i < c2 - 1; i++)
for (j = i + 1; j < c2; j++)
{
if(b[i] > b[j])
{
temp = b[i];
b[i] = b[j];
b[j] = temp;
}
}
for (i = 0; i < c1 - 1; i++)
for (j = i + 1; j < c1; j++)
{
if(a[i] < a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
for (j=0; j < c1; j++)
{
printf("\n %d ", a[j]);
}
for (j=0; j < c2; j++)
{
printf("\n %d ", b[j]);
}
getch();
void clrscr();
return 0;
}