给定两个数字L&R,查找位于L和R之间的所有数字的按位和
制约因素1<= L,R <= (2^32).
1<= L,R <= (2^32)
LL step = 1; while(L!=R) { L/=2; R/=2; step*=2; } cout<<L*step<<endl;
有人可以帮我解释上面代码背后的解释或逻辑吗?
bit-manipulation bitwise-operators bitwise-and
bit-manipulation ×1
bitwise-and ×1
bitwise-operators ×1