import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int[] str = new int[10];
Scanner in = new Scanner(System.in);
for (int i=0;i<10;i++){
str[i] = in.nextInt();
}
quickSort(0,str.length-1,str);
for (int i=0;i<str.length;i++){
System.out.print(str[i]+" ");
}
}
public static void quickSort(int left,int right,int[] str){
int i,j,t;
int temp;
if(left>right){
return;
}
temp = str[left];
i=left;
j=right;
while (i!=j){
while (str[j]>=temp&&i<j){
j--;
}
while (str[i]<=temp&&i<j){
i++;
}
if (i<j){
t = str[i];
str[i] = str[j];
str[j] = t;
}
}
str[left] = str[i];
str[i] = temp;
quickSort(left,i-1,str);
quickSort(i+1,right,str);
}
}
個人記錄用