[STL训练]sort练习-题解(各语言代码) 摘要:**python** ```python from heapq import nlargest print(*nlargest(int(input().split()[1]),map(int,i…… 题解列表 2022年04月01日 0 点赞 0 评论 360 浏览 评分:0.0
1983: 蓝桥杯算法提高VIP-求指数 摘要:解题思路:注意事项:参考代码:n,m=map(int,input().split()) for i in range(1,m+1): print('%12d'%(n**i)…… 题解列表 2022年04月01日 0 点赞 0 评论 282 浏览 评分:0.0
2620: 蓝桥杯2021年第十二届国赛真题-大写 摘要:解题思路:注意事项:参考代码:st=input() for i in st: if i.islower(): print(i.upper(),end=''…… 题解列表 2022年04月01日 0 点赞 0 评论 412 浏览 评分:0.0
求最后一位非零的三种快捷方法 摘要:解题思路:注意事项:参考代码:# 计算n!最右边的那个非0的数字是多少。# 例如,5!=1*2*3*4*5=120,因此5!最右边的那个非0的数字是2。# 再如,7!=5040,因此7!最右边的那个非…… 题解列表 2022年04月01日 0 点赞 0 评论 414 浏览 评分:9.9
remove是满分,但是直接pop就错了,求解 摘要:解题思路:注意事项:参考代码:li=list(map(int,input().split()))# li.pop()出错了if 0 in li: # 去除零值 li.remove(0)li…… 题解列表 2022年04月01日 0 点赞 0 评论 395 浏览 评分:2.0
题目看了半天就我英语跟屎一样吗 摘要:解题思路:定义函数为求x循环体的长度,因为输入一行输出一行,利用while注意事项:参考代码:def chang(x): a=0 while x>1: if x%2==0: …… 题解列表 2022年04月01日 0 点赞 0 评论 332 浏览 评分:8.0
用列表储存字符串的每个元素,再逆序 摘要:解题思路:用列表储存字符串的每个元素,再逆序注意事项:参考代码:a=input()b=[]for i in a: b.append(i)b=reversed(b)for i in b: p…… 题解列表 2022年04月01日 0 点赞 0 评论 163 浏览 评分:0.0
素数只有1和它本身两个因数 摘要:解题思路:因数数目等于2,为素数,注意参数还原注意事项:参考代码:n=int(input())a=[]for i in range(1,n+1): b=0 for j in range(1…… 题解列表 2022年04月01日 0 点赞 0 评论 328 浏览 评分:0.0
分类讨论注意初始参数还原为0 摘要:解题思路:利用while循环实现持续输入,在有题目条件写出判断式子注意事项:参考代码:while True: n=int(input()) if n==0: break …… 题解列表 2022年04月01日 0 点赞 0 评论 209 浏览 评分:0.0
循环里的分类讨论 摘要:解题思路:一个数储存/3的余数,表示没用的空瓶子,一个数储存/3的整除,表示拿去换的瓶子注意事项:参考代码:c=0while True: x=int(input()) if x==0: …… 题解列表 2022年03月31日 0 点赞 0 评论 377 浏览 评分:0.0