请问哪里出问题了?
输入一个数组,将前半个数组按升序排列,后半个数组按降序排列,输出排列后的数组.#include<stdio.h>
void abc(int *p,int *q)
{int temp;
temp=*p;
*p=*q;
*q=temp;
}
void sort_a(int *read,int n)
{int i,j;
for(i=0;i<n/2;i++)
for(j=0;j<n/2-i-1;j++)
if(read+j<read+(j+1))
{abc(read+j,read+(j+1));}
for(i=0;i<n/2;i++)
printf("%d",read[i]);}
void sort_b(int *read,int n)
{int i,k=n-1,j;
if(n%2==0)
i=n/2;
else i=n/2+1;
for(i=n/2;i<n;i++)
for(j=n/2;j<(n-i+3);j++)
if(read+j>read+(j+1))
{abc(read+j,read+(j+1));}
for(i=n/2;i<n;i++)
printf("%d",read[i]);}
main()
{int read[100],n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d",&read[i]);}
sort_a(read,n);
sort_b(read,n);
return 0;}
哪里出问题了?