import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class BubbleSort { private static int a[] = new int[12]; private static BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); public static void bubbleSort(int a[], int n) { int i, j, last; i = n - 1; while (i > 0) { last = 0; for (j = 0; j < i; j++) { if (a[j + 1] < a[j]) { int temp = a[j + 1]; a[j + 1] = a[j]; a[j] = temp; last = j; } } i = last; } } public static void main(String args[]) { try { for (int i = 0; i <= a.length - 1; i++) { a[i] = Integer.parseInt(in.readLine()); } } catch (IOException e) { e.printStackTrace(); } bubbleSort(a,a.length); for(int i =0;i<=a.length-1;i++){ System.out.print(a[i]+" "); } } }