#include<iostream>
#include<string>
#include<vector>
using namespace std;
void QuickSort(int a[], int left, int right)
{//形参和实参的问题,因为数组做形参会自动转化为指针
if (right<left)
return;
int L = left;
int R = right;
int M = a[left];
while (L != R)
{
while (a[R]>=M && R > L)
R--;
while (a[L]<=M && L < R)
L++;
if (L<R)
{
int temp = a[R];
a[R] = a[L];
a[L] = temp;
}
}
a[left] = a[L];
a[L] = M;
QuickSort(a, left, L - 1);
QuickSort(a, L + 1, right);
}
int main()
{
int a[10] = { 6, 1, 27, 9, 3, 4, 5, 10, 8 };
QuickSort(a, 0, 9);
for (int i = 0; i<10; i++)
{
cout << a[i] << endl;
}
}
#include&lt;iostream&gt;#include&lt;string&gt;#include&lt;vector&gt;using namespace std;void QuickSort(int a[], int left, int right){//形参和实参的问题,因为数组做形参会自动转化为指针 if (right&lt;left) return; in...