4.29python
题目:

代码:(?)
list = input().split()
list1 = []
list2 = []
for i in range(len(list)):
if (i+1)%3 != 0 and (i+1)%2 == 0:
list1.append(int(list[i]))
elif (i+1)%3 == 0:
list2.append(int(list[i]))
list1.sort()
list2.sort(reverse = True)
j,k = 0,0
for i in range(len(list)):
if (i+1)%3 != 0 and (i+1)%2 == 0:
del list[i]
list.insert(i,str(list1[j]))
j += 1
elif (i+1)%3 == 0:
del list[i]
list.insert(i,str(list2[k]))
k += 1
print(' '.join(list))
---------------------
作者:GrWx
来源:CSDN
原文:https://blog.csdn.net/and_w/article/details/50768811
版权声明:本文为博主原创文章,转载请附上博文链接!
4.29python的更多相关文章
随机推荐
- Excel 2010如何打开多个独立窗口?
https://jingyan.baidu.com/article/86fae346acca7d3c49121ad4.html
- PHP 【二】
EOF EOF(heredoc)是一种在命令行shell(如sh.csh.ksh.bash.PowerShell和zsh)和程序语言(像Perl.PHP.Python和Ruby)里定义一个字符串的方法 ...
- POJ 2031 Building a Space Station (计算几何+最小生成树)
题目: Description You are a member of the space station engineering team, and are assigned a task in t ...
- 008_tcp探测
一. 线上出现了监控指标抖动,netscaler心跳监测的问题,如下图: 二.工具如下: 原理参考:https://www.dearcodes.com/index.php/archives/17/ N ...
- Misc杂项隐写题writeup
MISC-1 提示:if you want to find the flag, this hint may be useful: the text files within each zip cons ...
- java+selenium实现web自动化
1.环境搭建: eclipse4.8 + java1.8 + selenium-3.14 基本都是使用最新版 (1) eclipse4.5下载:http://www.eclipse.org/downl ...
- pandas 中处理数据的函数和方法
- MySQL视图,函数,触发器,存储过程
1. 视图 视图是一个虚拟表,它的本质是根据SQL语句获取动态的数据集,并为其命名,用户使用时只需使用[名称]即可获取结果集,可以将该结果集当做表来使用. 使用视图我们可以把查询过程中的临时表摘出来, ...
- python数据类型小测试
# 1. 有两个列表,其中一个列表a,每一项映射到另一个列表b每一项,先对a排序,要求b的中映射关系位置保持不变,给b也按照排序, (b的8对应a的[1,2], 7对应[3,4] ... ) a = ...
- SQL insert
INSERT INTO 插入语句 INSERT INTO语句用于在表中插入新记录. 可以用两种方式编写INSERT INTO语句. 第一种方法指定列名和要插入的值: 1 2 INSERT INTO t ...