根据题目要求及老师要求,下方区域为python代码。。
新手上路请轻喷
alist = list(input())# this ask the user to input their list.
n = len(alist)#to find out the lence and the different set of the list
for j in range(n-1, 0, -1):#choose one of the data , compare with the next one
for i in range(j):
if alist[i] > alist[i+1]:
alist[i], alist[i+1] = alist[i+1], alist[i]
#if the first one is bigger than the second.change their position.
print(alist)