#include<stdio.h>
void qsort(int a[],int begin, int end);int main(){ int a[]={6,7,3,4,5,2,9,10}; qsort(a,0,sizeof(a)/sizeof(a[0])-1); for(int i=0;i<sizeof(a)/sizeof(a[0]);i++) { printf("%d, ",a[i]); } return 0;}
void qsort(int a[],int begin, int end){ if(begin<end) { int pirot=a[end]; int i,j,tmp; i = begin-1; j=begin; while(j<end) { if(a[j]<=pirot) { i++; tmp=a[i]; a[i]=a[j]; a[j]=tmp; } j++; } i++; tmp = a[i]; a[i]=a[end]; a[end]=tmp; qsort(a,begin,i-1); qsort(a,i+1,end); }}