stop()
输出是这样的
def dectobin(n):
return int(bin(n)[2:])
print(int(bin(n)[2:]))
def solution(r):
k = dectobin(r)
print(k)
m = str(k)
maxgap=0
running=0
for i in (0,len(m)-1):
if m[i] == 0:
running = running+1
elif m[i] == 1:
if running > maxgap:
maxgap = running
running = 0
print(maxgap)
x = input("give the number")
solution(x)
为什么?