好久不写了练练手 解题思路:首先看输入格式,是不限制输入次数,那就while接收,不放心就再加个try-except,这一题空间限制很小,那干脆多占点空间换时间了,接收每一组数据后化为整型,然后截去第一位计数用的,留下有用的数据,同时加个if判定遇到输入0时停下来;给截取后的列表b做一个绝对值版本, 题解列表 2025年01月04日 1 点赞 0 评论 780 浏览 评分:10.0
1169: 绝对值排序(sort) 摘要:解题思路: 核心:l.sort(key=abs, reverse=True)注意事项: 去掉绝对值最大的数参考代码:while True: l = [int(x) for x i…… 题解列表 2024年08月17日 0 点赞 0 评论 681 浏览 评分:0.0
无聊的星期六 摘要:解题思路: 将读取的字符串放到数组里面,删除第一个数字 生成两个列表,一个放负数,一个放排序好的 判断两个表哪几个值一样然后替换掉他的负数注意事项: 属于是有点脱裤子放屁,但是…… 题解列表 2024年04月14日 0 点赞 0 评论 561 浏览 评分:0.0
1169: 绝对值排序 摘要:解题思路:注意事项:参考代码:while True: try: n = list(map(int, input().split())) a = n[1:]…… 题解列表 2024年04月08日 0 点赞 0 评论 506 浏览 评分:0.0
小白随便写的,记录一下 ```pythondefsolve_sort(li):new_li=list(map(int,li[1:]))new_li.sort(key=abs,reverse=True)foriinnew_li:print(i,end='')q=[]li=input().split()whilelen(li)! 题解列表 2024年03月24日 0 点赞 0 评论 605 浏览 评分:0.0
用冒泡排序做的,没有时间超限 摘要:解题思路:注意事项:参考代码:while True: li=list(map(int,input().split())) if li[0]==0: break else…… 题解列表 2024年03月11日 0 点赞 0 评论 453 浏览 评分:0.0
绝对值排序(python) 摘要:解题思路:注意事项:参考代码:while True: nums = list(map(int, input().split())) n = nums[0] if n == 0: …… 题解列表 2023年12月18日 0 点赞 0 评论 472 浏览 评分:0.0
最短的代码 摘要:while True: line = input().strip() if line == '0': break numbers = l…… 题解列表 2023年10月18日 0 点赞 0 评论 539 浏览 评分:7.3
绝对值排序 摘要:解题思路:分别用列表来存放数据的原值和绝对值注意事项:参考代码:while True: try: L = list(map(int,input().split())) …… 题解列表 2023年03月21日 0 点赞 0 评论 556 浏览 评分:0.0
帅气的题解 摘要:解题思路:sort()函数的调用注意事项:ask()函数的掌握参考代码:while True: try:#加个try保险 a=list(map(int,input().strip(…… 题解列表 2022年12月22日 0 点赞 0 评论 501 浏览 评分:0.0