package com.bdqn.yingyun; public class XuanZePaiXu { public static void main(String[] args) { int[] arr = { 111, 12, 3, 45, 56, 55 }; for (int i = 0; i < arr.length - 1; i++) { for (int j = i + 1; j < arr.length; j++) { if (arr[i] > arr[j]) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } } } for (int x = 0; x < arr.length; x++) { System.out.print(arr[x] + " "); } } }