以下程序采用冒泡排序算法,将输入的整数按升序进行排序并输出。 请将以下程序填写完整。
时间: 2023-06-05 17:47:33 浏览: 195
下面是程序采用冒泡排序算法,将输入的整数按升序进行排序并输出。请将以下程序填写完整。
# 输入整数
num_list = list(map(int, input().split()))
# 冒泡排序
for i in range(len(num_list)):
for j in range(i+1, len(num_list)):
if num_list[i] > num_list[j]:
num_list[i], num_list[j] = num_list[j], num_list[i]
# 输出排序后的整数
for num in num_list:
print(num, end=" ")
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![doc](https://img-home.csdnimg.cn/images/20210720083327.png)