#include using namespace std; void split(int a[], int f, int l, int& sp) { int i, x, temp; x = a[f]; sp = f; for (int i = f+1; i <= l; i++) if ( a[i] < x ) { sp++; temp = a[sp]; a[sp] = a[i]; a[i] = temp; }//end if for temp = a[sp]; a[sp] = a[f]; a[f] = temp; }//end split void quick(int a[], int first, int last) { int sp; if (first < last) { split (a, first, last , sp); quick(a, first, sp-1); quick(a, sp+1, last); } }//end quick int main() { srand(time(0)); const int SIZE = 5; int a[SIZE]; for (int i = 0; i < SIZE; i++) a[i] = rand()%100; quick(a, 0, SIZE-1); for (int i = 0; i < SIZE; i++) cout << a[i] <<" "; cout <