您的位置:首页 > 其它

zoj 2417 Lowest Bit

2011-12-24 23:20 441 查看
#include "iostream"
using namespace std;

int main()
{
int num;
while (cin >> num && num != 0)
{
int count = 0, ans = 1;
while (num % 2 != 1)
{
count++;
num /= 2;
}
for (int i = 0; i < count; i++)
ans *= 2;
cout << ans << endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: