莫燿汶
莫燿汶
全部文章
题解
归档
标签
去牛客网
登录
/
注册
莫燿汶的博客
第一语言python的小白
全部文章
/ 题解
(共55篇)
题解 | #牛牛的替换#
st = input()[2::].split() rep = input() a = 0 for i in range(2): rep = rep.replace(st[a],st[a+1]) a += 2 print(rep)
Python3
2022-05-20
0
329
题解 | #记票统计#
import sys mamber, name, pepple, votes = [line.replace("\n", "").split() for line in sys.stdin] a = 0 for i in name: answer = votes.count(i) ...
Python3
2022-05-06
0
369
题解 | #[NOIP2010]数字统计#
L, R = map(int, input().split()) lis = [] for i in range(L, R + 1): lis += list(str(i)) print(lis.count("2"))
Python3
2022-05-03
0
337
题解 | #The Biggest Water Problem#
num = input() while True: if len(num) > 1: num = str(sum(list(map(int, list(num))))) else: print(num) break
Python3
2022-05-03
0
314
题解 | #数位五五#
a, b = map(int, input().split()) n = 0 for i in range(a, b + 1): ii = sum(list(map(int, list(str(i))))) # 现将数字转换成str再转成list再用map将元素转成int在将map对象转成l...
Python3
2022-05-03
0
371
题解 | #小乐乐计算函数#
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
428
题解 | #字符串操作#
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
368
题解 | #添加逗号#
stri = int(input()) print(f"{stri:,}") # format格式化输出有千位分割符
Python3
2022-04-28
2
503
题解 | #[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
326
题解 | #[NOIP2018]标题统计#
words = input() num = len(words) for i in words: if i ==" " or i == "\n": num -= 1 print(num) !=会出现偏差,在判断条件时最好不要用!=
Python3
2022-04-26
0
227
首页
上一页
1
2
3
4
5
6
下一页
末页