#include<stdio.h> void quickstr(int a[],int n,int low,int high) { int i,j,x; if(low>=high) return; i=low;j=high; a[0]=a[i]; while(i!=j) { while(a[j]>a[0]&&j>i) j--; if(i<j) {a[i]=a[j];i++;} while(a[i]<a[0]&&j>i) i++; while(i<j) { a[j]=a[i];j--;} } a[i]=a[0];i++;j--; quickstr(a,n,low,j); quickstr(a,n,i,high);
}
main() { int a[]={7,5,1,3,8,13,6}; int n=7,i; int low=1,high=7; quickstr(a,n,low,high); for(i=1;i<n;i++) printf("a[i]=%d/n",a[i]); printf("/n"); }