内存限制:512.0MB C/C++时间限制:1.0s Java时间限制:3.0s Python时间限制:5.0s
给定一个长度为n的数列,将这个数列按从小到大的顺序排列。1<=n<=200
输入格式
第一行为一个整数n。
第二行包含n个整数,为待排序的数,每个整数的绝对值小于10000。
输出格式
输出一行,按从小到大的顺序输出排序后的数列。
样例输入
5
8 3 6 4 9
样例输出
3 4 6 8 9
#includeusing namespace std; const int N=1e6+10; int n; int b[N]; void quick_sort(int b[],int l,int r)//注意模板准确性,注意边界问题 { if(l>=r) return; int x=b[l],i=l-1,j=r+1; while(i x); if(i >n; for(int i=0;i >b[i]; quick_sort(b,0,n-1); for(int i=0;i



