public static void selectSort(int[] a){
int i,j;
int temp=0;
int flag=0;
int len=a.length;
for(i=0;i<len;i++){
temp=a[i];
flag=i;
for(j=i+1;j<len;j++){
if(a[j]<temp){
temp=a[j];
flag=j;
}
}
if(flag!=i){
a[flag]=a[i];
a[i]=temp;
}
}
}
int i,j;
int temp=0;
int flag=0;
int len=a.length;
for(i=0;i<len;i++){
temp=a[i];
flag=i;
for(j=i+1;j<len;j++){
if(a[j]<temp){
temp=a[j];
flag=j;
}
}
if(flag!=i){
a[flag]=a[i];
a[i]=temp;
}
}
}