参考代码:
def fun_1(ls): # 输入10个数
ls = list(map(int, input().split()))
return ls
def fun_2(ls): # 进行处理
my_min = min(ls)
my_index = ls.index(my_min)
temp = ls[0]
ls[0] = ls[my_index]
ls[my_index] = temp
my_max = max(ls)
my_new_index = ls.index(my_max)
new_temp = ls[-1]
ls[-1] = ls[my_new_index]
ls[my_new_index] = new_temp
return ls
def fun_3(ls): # 输出10个数
for i in range(10):
print(ls[i], end=" ")
ls = []
rel = fun_1(ls)
new_rel = fun_2(rel)
fun_3(new_rel)
0.0分
0 人评分