标签:static [] java str ++ bsp 冒泡排序 string i++
例:
public static void main(String[] args) {
int[] a = {3,1,4,22,0};
for (int i = 0; i < a.length-1;i++) {
for (int j = 0; j < a.length-1-i;j++) {
if (a[j] > a[j+1]) {
int tmp = a[j];
a[j] = a[j+1];
a[j+1] = tmp;
}
}
}
for (int i = 0; i < a.length;i++) {
System.out.println(a[i]);
}
}
标签:static [] java str ++ bsp 冒泡排序 string i++
原文地址:http://www.cnblogs.com/leixuedong/p/6677536.html