_Kuuga
_Kuuga
全部文章
分类
题解(3)
归档
标签
去牛客网
登录
/
注册
_Kuuga的博客
全部文章
(共3篇)
题解 | #参数解析#
Python递归解析处理一点删一点,再处理再删,删完为止 mycommand = input() def parse(mycommand, commands = []): indexLeft = mycommand.find('"') if indexLeft == -1...
2021-08-05
1
402
题解 | #统计每个月兔子的总数#
容易理解的方法,monthBirth最后就是个斐波那契 import sys for x in sys.stdin: x = int(x.strip()) monthBirth = [1] #存放每个月出生的兔子数,第一个月是1 for i in range(1, x): ...
2021-08-03
2
322
题解 | #求int型正整数在内存中存储时1的个数#
递归 def to2(x, n = 0): if x%2 == 1: n += 1 if x < 1: print(n) else: to2(x//2, n) to2(int(input()))
2021-08-02
1
221