题解 | #求最大连续bit数#
求最大连续bit数
https://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
while 1: try: n=int(input()) binary='' while n//2 != 0: binary += str(n%2) n = n//2 binary = binary+str(n) #print(binary) bin=binary.replace('0',' ').split() #print(bin) print(max([len(i) for i in bin])) except: break