编辑代码

package com.etime.test019;
import java.util.Arrays;
public class Test13 {
	public static void main(String[] args) {
		int[] array = {5,68,1,56,8,56,84,586,4,55,6,4,565,45,56,4556,45415,5455,5445,5754,4456,6745,6445,6745557,998,4657,5675,565756,576,4576557,5687,6557,5687,57867586,526,7565,7586,788};
		int len = array.length;
		System.out.println("排序前的数组为:"+Arrays.toString(array));
		int temp = 0;
		for (int i = 0; i < len - 1; i++) {
			for (int j = 0; j < len - 1 - i; j++) {
				if (array[j] > array[j + 1]) {
					temp = array[j + 1];
					array[j + 1] = array[j];
					array[j] = temp;
				}}}
		System.out.println("排序后的数组为:"+Arrays.toString(array));
	}
}