#include<stdio.h> #include<stdlib.h> #define Maxsize 100 int poit(int s[],int low,int high){ int temp = s[low]; while(low<high){ while(low<high&&s[high]>=temp) high--; s[low] = s[high]; while(low<high&&s[low]<=temp) low++; s[high] = s[low]; } s[low] = temp; return low; } void quicksort(int s[],int low,int high){ if(low<high){ int mid = poit(s,low,high); quicksort(s,low,mid-1); quicksort(s,mid+1,high); } } int main(){ int n,a[Maxsize]; while(~(scanf("%d",&n))){ for(int i=0;i<n;i++){ scanf("%d",&a[i]); } quicksort(a,0,n-1); for(int i=0;i<n;i++){ printf("%d ",a[i]); } printf("\n"); } return 0; }