public class SelectSort {
public static void main(String[] args) {
int []b={7,5,3,21,65,11};
selectsort(b);
}
public static void selectsort(int[] a){
int temp=0;
for(int i=0;ia[j]){
minIndex=j;
}
}
if(i!=minIndex){ //不等于则交换
temp=a[minIndex];
a[minIndex]=a[i];
a[i]=temp;
}
}
for (int value : a) {
System.out.println(value);
}
}
}



