# 冒泡排序

<p>用冒泡排序编写一个函数&#xff0c;允许接受多个数字的输入&#xff0c;不使用sort方法&#xff0c;给数字从小到大排序&#xff0c;最终输出从小到大的列表。</p>

## template

```python
#!/usr/bin/python3
def bubbleSort(arr):
	n = len(arr)
	for i in range(n):
		for j in range(0, n-i-1):
			if arr[j] > arr[j+1] :
				arr[j], arr[j+1] = arr[j+1], arr[j]
x=input("请输入数字,空格分隔：")
xlist=x.split(" ")
arr = [int(xlist[i]) for i in range(len(xlist))]
bubbleSort(arr)
print ("排序后的数组:")
for i in range(len(arr)):
	print ("%d" %arr[i]),
```

## 答案

```python

```

## 选项

### A

```python

```

### B

```python

```

### C

```python

```