标签:static str array node void package tar public i+1
package com.bjpowernode.t01;
/*
* 选择排序
*/
public class TestArray10 {
public static void main(String[] args) {
int[] a = {4,2,7,3,6};
//外层
for(int i=0; i<a.length-1; i++) {
//里层
for(int j=i+1; j<a.length; j++) {
if(a[i] > a[j]) {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
for(int i=0; i<a.length; i++) {
System.out.println(a[i]);
}
}
}
标签:static str array node void package tar public i+1
原文地址:https://www.cnblogs.com/Koma-vv/p/9543700.html