public class selectSort {
static void select(int a[]) {
int tmp, index;
for (int i = 0; i < a.length - 1; i++) {
index=i;
for (int j = i + 1; j < a.length; j++) {
if(a[j]<a[index]) {
index = j;
}
}
if(index!=i){
tmp=a[i];
a[i]=a[index];
a[index]=tmp;
}
}
}
public static void main(String args[]) {
int[] a = new int[10];
for (int i = 0; i < 10; i++) {
a[i] = 100 - i;
}
select(a);
for (int b : a) {
System.out.print(b + " ");
}
}
}