标签:blog ar os sp java for div log bs
//冒泡排序 public class Demo6 { public static void main(String[] args) { int []age = {1,2,36,363,56,95,12,32,1232,3263}; for (int i = 0; i < age.length; i++) { for (int j = i+1; j <= age.length-1; j++) { if(age[i] > age[j]){ int temp = age[i]; age[i] = age[j]; age[j] = temp; } } } System.out.println(Arrays.toString(age)); } } //输出为:[1, 2, 12, 32, 36, 56, 95, 363, 1232, 3263]
标签:blog ar os sp java for div log bs
原文地址:http://www.cnblogs.com/wikiki/p/4129628.html