# 数组排序

<p>编写一个JavaApplication程序,将随机生成的无序数组使用冒泡排序,将这个混乱的数组变成一个从小到大排列的有序的数组并输出。</p>

## template

```java
class demo_sort {
	public static void main(String[] args) {
		int[] numbers = new int[] { 1, 5, 8, 2, 3, 9, 4 };
		for (int i = 0; i < numbers.length - 1; i++) {
			for (int j = 0; j < numbers.length - 1 - i; j++) {
				if (numbers[j] > numbers[j + 1]) {
					int temp = numbers[j];
					numbers[j] = numbers[j + 1];
					numbers[j + 1] = temp;
				}
			}
		}
		System.out.println("从小到大排序后的结果是:");
		for (int i = 0; i < numbers.length; i++)
			System.out.print(numbers[i] + " ");
	}
}
```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```