#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
int count = 0, maxsize = 0;
while (n)
{
if (n & 1)
{
count++;
maxsize = max(maxsize, count);
}
else
{
count = 0;
}
n = n >> 1;
}
cout << maxsize << endl;
}
system("pause");
return 0;
}
求最大连续bit数
猜你喜欢
转载自blog.csdn.net/weixin_44781382/article/details/105018584
今日推荐
周排行