莫燿汶
莫燿汶
全部文章
分类
题解(62)
归档
标签
去牛客网
登录
/
注册
莫燿汶的博客
第一语言python的小白
全部文章
(共60篇)
题解 | #小乐乐计算函数#
a, b, c = map(int, input().split()) divisor = max(a + b, b, c) dividend = max(a, b + c, c) + max(a, b, b + c) print("%.2f" % (divisor / dividend))
Python3
2022-05-03
0
416
题解 | #字符串操作#
n, m = map(int, input().split()) words = list(input()) for i in range(m): l, r, c1, c2 = input().split() a = 0 for j in words: if ...
Python3
2022-05-03
0
356
题解 | #添加逗号#
stri = int(input()) print(f"{stri:,}") # format格式化输出有千位分割符
Python3
2022-04-28
2
492
题解 | #[NOIP2008]笨小猴#
words = input() lis = [] for i in words: lis.append([i, words.count(i)]) # 将字母及对应的出现次数放到嵌套列表里排序 lis.sort(key=lambda x: x[1]) main = lis[-1][1] - ...
Python3
2022-04-28
0
334
题解 | #[NOIP2018]标题统计#
words = input() num = len(words) for i in words: if i ==" " or i == "\n": num -= 1 print(num) !=会出现偏差,在判断条件时最好不要用!=
Python3
2022-04-26
0
229
题解 | #KiKi判断上三角矩阵#
题目的问题是只要对角线下的数字是0就可以了 num = int(input()) lis = [] for i in range(num): lis += list(map(int, input().split()[0:i:])) # 获取所有对角线以下的数字 for j in lis: ...
Python3
2022-04-25
0
242
题解 | #矩阵计算#
a, b = map(int, input().split()) lis = [] for i in range(a): lis += [int(j) for j in input().split() if int(j) > 0] print(sum(lis))
Python3
2022-04-24
0
260
题解 | #最高身高#
a, b = map(int, input().split()) lis1, lis2 = [], [] for i in range(a): lis = list(map(int, input().split())) lis1.append(lis) lis2 += lis...
Python3
2022-04-24
0
252
题解 | #班级成绩输入输出#
while True: try: num = list(map(float, input().split())) for i in num: print(f"{i:.1f}", end=" ") print(f"{sum...
Python3
2022-04-23
0
250
题解 | #序列中删除指定数字#
n, m, mm = input(), input().split(), input() a = [i for i in m if i != mm] for i in a: print(i, end=" ")
Python3
2022-04-23
0
273
首页
上一页
1
2
3
4
5
6
下一页
末页