void ksort(int *num, int low, int hig) { if (hig<low+2) return ; int e = hig, p = low; if (low<hig) { while ((++low<e) && (num[low] <= num[p])); while ((--hig>p) && (num[hig] >= num[p])); if (low<hig) swap(num[low], num[hig]); } swap(num[hig], num[p]); ksort(num, p, hig); ksort(num, low, e); }