题解 | #字符串反转#
求最大连续bit数
http://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
#使用正则表达式快速匹配最长“111”型字符串
import re
def dfx(er):
conten, len_max = re.compile("1*"), 0
resoult = re.findall(conten, er)
for i in resoult:
if len(i) > len_max:
len_max = len(i)
return len_max
while True:
try:
print(dfx(bin(int(input()))))
except:
break