#include <iostream>
using namespace std;
void quickSort(int mas[], int first, int last) {
int f = first;
int l = last;
int mid = mas[(f + l) / 2];
do {
while (mas[f] < mid) f++;
while (mas[l] > mid) l--;
if (f <= l) {
swap(mas[f], mas[l]);
f++;
l--;
}
} while (f < l);
if (first < l) quickSort(mas, first, l); // ???
if (f < last) quickSort(mas, f, last); // ???
}
int main() {
setlocale(LC_ALL, "rus");
srand(time(NULL));
const int SIZE = 11;
int arr[SIZE];
for (int i = 0; i < SIZE; i++)
{
arr[i] = rand() % 10;
cout << arr[i] << "\t";
}
cout << "Исходный массив";
cout << endl;
int first = 0;
int last = SIZE - 1;
quickSort(arr, first, last);
for (int i = 0; i < SIZE; i++)
{
cout << arr[i] << "\t";
}
cout << "Отсортированный массив";
}