python编写函数myfunc(),模拟内置函数sorted()功能。注:程序中不允许出现sorted()函数
运行结果:
def myfunc(a):
for i in range(len(a)):
for j in range(i+1, len(a)):
if a[j] < a[i]:
tmp = a[i]
a[i] = a[j]
a[j] = tmp