栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

英语题目作业(26)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

英语题目作业(26)

原题:

Lowest Bit

 1000ms  32768K

描述:

Given an positive integer A (1 <= A <= 100), output the lowest bit of A.

For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.

Another example goes like this: given A = 88, we can write A in binary form as 1011000, so the lowest bit of A is 1000, so the output should be 8.

输入:

Each line of input contains only an integer A (1 <= A <= 100). A line containing "0" indicates the end of input, and this line is not a part of the input data.

输出:

For each A in the input, output a line containing only its lowest bit.

样例输入:
26
88
0
样例输出:
2
8

(链接:Lowest Bit | JXNUOJ)

翻译:

最低位

已知一个正整数A(1<=A<=100),输出A的最低位。

例如,整数A=26,我们可以写出A的二进制数11010,所有A的最低位是10,输出应该输出2.

另一个相似的例子是:A=88,我们可以写出A的二进制数1011000,所有A的最低位是1000,所有输出8。

输入:

每行包括一个整数A(1<=A<=100).某行输入为0则代表输入结束,并且0不作为输入数据。

输出:

对于每一个输入A,在一行输出其最低位。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/738948.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号