#include<stdio.h>
#include<stdlib.h>
#define MAX 100
void sort(int a[],int l,int r){
if(l<r){
int x=a[l];
int i=l,j=r;
while(i<j){
while(i<j && a[j]>x){
j--;
}
if(i<j){
a[i++]=a[j];
}
while(i<j && a[i]<x){
i++;
}
if(i<j){
a[j--]=a[i];
}
}
a[i]=x;
sort(a,l,i-1);
sort(a,i+1,r);
}
}
int main(){
int n,a[MAX];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
sort(a,0,n-1);
for(int i=0;i<n;i++){
printf("%d ",a[i]);
}
return 0;
}
06-17
1512
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-30
2066
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-14
664
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-25