参考代码:
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 人评分
C语言程序设计教程(第三版)课后习题6.5 (Java代码)浏览:1157 |
输出九九乘法表 (C语言代码)浏览:561 |
简单的a+b (C语言代码)浏览:671 |
钟神赛车 (C++代码)浏览:879 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:548 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:468 |
大小写转换 (C语言代码)浏览:876 |
妹子杀手的故事 (C语言代码)浏览:1245 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:476 |
简单的for循环浏览:1435 |