85年的老测试
85年的老测试
全部文章
分类
题解(8)
归档
标签
去牛客网
登录
/
注册
85年的老测试的博客
全部文章
(共8篇)
题解 | #参数解析#
这题研究时间长了 #先根据空格换行 cmd = input() words = cmd.split() my_str='' #设置标志位if_return默认为True if_return = True for i ...
Python3
2022-01-24
1
331
题解 | #统计字符#
这个题目让我学会了很多个函数 import sys #没有优雅,就是硬遍历 for my_str in sys.stdin: letter_count = 0 &...
Python3
2022-01-21
14
1535
题解 | #字符串加密#
大佬的解答很优雅,学习 #每次输入有两行,还有多组输入,这个不知道怎么处理才是优雅的,先try,except吧 while True: try: &nbs...
Python3
2022-01-21
0
343
题解 | #字符个数统计#
知道的内置函数越多编码越简单,大佬们给力 import sys #使用stdin时输入有换行\n,使用input时却没有,真是神奇 my_str = sys.stdin.readline().rstrip() #用set去重的思路来自大佬 unique_my_st...
Python3
2022-01-21
0
255
题解 | #杨辉三角的变形#
大佬都说是2324的循环,那就不要想着把n行的数都算出来了。。。 '''我猜中了开始,却没有猜中结局''' import sys for num in sys.stdin: loop_list =...
Python3
2022-01-20
0
319
题解 | #统计每个月兔子的总数#
还是得看大佬的题解,灵感来自斐波那契数列 import sys for month in sys.stdin: #小于3个月每个月都是1只,大于等于3个月走else if int(month)&l...
Python3
2022-01-20
0
367
题解 | #汽水瓶#
又是根据大佬题解默写的 import sys def get_bottle(n): count = 0 my_get = n /...
Python3
2022-01-20
0
316
题解 | #表达式求值#
根据大佬的题解自己默写的一个,反正验证通过了😂 import sys def get_pn(num): pn_list = [] for i&...
Python3
2022-01-20
0
274