import java.util.Arrays; import java.util.Scanner; /** * @author zzb * @version V1.0 * @creat 2022 0925 16:35 */ public class test { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] nums = new int[n]; for (int i = 0; i < n; i++) { nums[i] = scanner.nextInt(); } int fist = nums.length - 1; while (true) { int last = 0; for (int i = 0; i < fist; i++) { if (nums[i] > nums[i + 1]) { int temp = nums[i]; nums[i] = nums[i + 1]; nums[i + 1] = temp; last = i; } } fist = last; if (last == 0) { break; } } for (int i = 0; i < nums.length; i++) { System.out.print(nums[i]+" "); } } }