1 Star 0 Fork 0

Adachi / 2021Besti信安

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
selectsort.py 389 Bytes
一键复制 编辑 原始数据 按行查看 历史
Adachi 提交于 2021-11-02 10:51 . update ch07-排序/selectsort.py.
#coding=utf-8
#选择排序
def selectsort(list):
n = len(list)
for i in range(0, n - 1):
j = i
while j < n:
if list[j] < list[i]:
list[j], list[i] = list[i], list[j]
j += 1
print('please enter the elements of the array\n')
b = input()
a = list(b.split())
a = [int(i) for i in a]
selectsort(a)
print(a)
1
https://gitee.com/chen-xialin/cxl20211413.git
git@gitee.com:chen-xialin/cxl20211413.git
chen-xialin
cxl20211413
2021Besti信安
master

搜索帮助