#!/usr/bin/env python
# -*- coding:utf-8 -*-

lst = [5,1,4,3,2]
for i in range(len(lst) - 1):
    for j in range(i + 1, len(lst)):
        if lst[i] > lst[j]:
            lst[i], lst[j] = lst[j], lst[i]
print('after sorted', lst)

 

相关文章:

  • 2021-11-02
  • 2022-12-23
  • 2021-08-28
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2022-02-06
  • 2021-10-28
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案