public class PaiXu1 {
public static void main(String[] args) {
int[] s = {345,879,456,870,221,902,148,234,478};
System.out.println("排序之前:");
System.out.println(Arrays.toString(s));
System.out.println("排序之后:");
int temp = 0;
for (int i = 0;i < s.length-1;i++){
for (int j = 0;j < s.length-1-i;j++){
if (s[j]>s[j+1]){
temp = s[j];
s[j] = s[j+1];
s[j+1] = temp;
}
}
}
System.out.println(Arrays.toString(s));
}
}