题解 | #求最大连续bit数#
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
while True: try: number = int(input()) bin_number = str(bin(number))[2:] # print(bin_number) result = sorted(bin_number.split('0'), key=lambda x: len(x), reverse=True)[0] print(len(result)) except: break