题解 | #求最大连续bit数#
求最大连续bit数
http://www.nowcoder.com/practice/4b1658fd8ffb4217bc3b7e85a38cfaf2
function solution(num){
let str = num.toString(2);
let arr=str.split('0')
let result = 0
for(let i=0; i<arr.length; i++){
if(arr[i].length > result){
result = arr[i].length
}
}
return result
}
let line
while(line = parseInt(readline())){
console.log(solution(line))
}