package xuyan.com;
public class Test {
/**
* @param args
*/
static int[] a={5,8,7,2,1,9,4,3,6};
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 0; i < a.length; i++) {
System.out.println(a[i]);
}
System.out.println("-------------------------------");
selectSort(a);
}
private static void selectSort(int[] a)
{
for(int i=0;i<a.length;i++)
{
for(int j=i;j<a.length;j++)
{
if(a[j]<a[i])
{
int temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
System.out.println(a[i]);
}
}
}