当前位置:网站首页>English topic assignment (26)

English topic assignment (26)

2022-07-05 04:30:00 m0_ sixty-five million seven hundred and eighty-eight thousand

The original title is :

Lowest Bit

 1000ms  32768K

describe :

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.

Input :

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.

Output :

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

The sample input :

26
88
0

Sample output :

2
8

( link :Lowest Bit | JXNUOJ

translate :

Its lowest

A positive integer is known A(1<=A<=100), Output A The lowest point of .

for example , Integers A=26, We can write A Binary number of 11010, all A The lowest bit of is 10, Output should output 2.

Another similar example is :A=88, We can write A Binary number of 1011000, all A The lowest bit of is 1000, All outputs 8.

Input :

Each line includes an integer A(1<=A<=100). A line is entered as 0 Then it means that the input ends , also 0 Not as input data .

Output :

For each input A, Output its lowest bit on one line .

原网站

版权声明
本文为[m0_ sixty-five million seven hundred and eighty-eight thousand ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140637059004.html