package Project01;
public class Code01{
public static void main(String[] args) {
int[] x= {5,3,1,2,0,6,7,4,9,8};
BuSort(x);
Printf(x);
}
public static void BuSort(int[] x){ //排序
int y;
for(int i=0;i<x.length-1;i++) {
for(int j=0;j<x.length-1-i;j++) {
if(x[j]>x[j+1]) {
y=x[j];
x[j]=x[j+1];
x[j+1]=y;
}
}
}
}
public static void Printf(int[] x) { //输出
System.out.print("排序后:");
for(int i=0;i<x.length;i++) {
System.out.print(x[i]+" ");
}
}
}