package paixu;
//选择排序从小到大
public class xuanze {
public static void main(String[] args) {
// TODO Auto-generated method stub
int shuzu[]={17,11,78,53,22,43,534};//创建数组
int i;
int j;
int temp;
int index;//设立一个用来记录交换的下标
for(i=0;i<shuzu.length-1;i++){
index=i;
for(j=i+1;j<shuzu.length;j++){
if(shuzu[j]<shuzu[index]){
index=j;
}
}
temp=shuzu[index];
shuzu[index]=shuzu[i];
shuzu[i]=temp;
}
for(int k=0;k<shuzu.length;k++){
System.out.print(shuzu[k]);
System.out.print(' ');
}
}
}