/* 快速排序 */
#include"stdio.h"
#include"stdlib.h"
int compare(const void* a,const void* b)
{return (*(int *)a-*(int *)b);
}int main()
{int i,a[]={32,29,59,8,22,68,89,77},n;n=sizeof(a)/sizeof(a[0]);printf("排序前:\n");for(i=0;i<n;i++)printf("%d ",a[i]);printf("\n");qsort(a,n,sizeof(int),compare);printf("排序后:\n");for(i=0;i<n;i++)printf("%d ",a[i]);printf("\n");return 0;
}