//升序排序
int sz []= {3,45,33,68,73,98,16,28};
for (int a : sz )
{
System.out.print (a + " ");
}
System.out.println();
for(int c = 1; c < sz.length; c++)
{
for (int a = 0; a < sz.length - c; a++)
{
if (sz[a] > sz[a+1])
{
int b = sz[a+1];
sz[a+1] = sz[a];
sz[a] = b;
}
}
}
for (int a : sz )
{
System.out.print (a + " ");
}
System.out.println();
//降序排列
int [] sz2 = {33,17,48,25,99,2,74,39};
for( int a1 : sz2)
{
System.out.print(a1 + " ");
}
System.out.println();
for(int c1 = 1; c1 < sz2.length; c1++)
{
for(int a1 = 0; a1 < sz2.length - c1; a1++)
{
if (sz2[a1] < sz2[a1 + 1])
{
int b1 = sz2[a1];
sz2[a1] = sz2[a1 + 1];
sz2[a1+1] = b1;
}
}
}
for( int a1 : sz2)
{
System.out.print(a1 + " ");
}
System.out.println();