摘要:
Description:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint... 阅读全文
摘要:
变换一个整数的符号,即正数变负数,负数变正数。1 int reverseSign(int n) {2 return ~n+1;3 } 阅读全文
摘要:
给出一个16位的无符号整数。称这个二进制数的前8位为“高位”,后8位为“低位”。现在写一程序将它的高低位交换。例如,数34520用二进制表示为:1000011011011000将它的高低位进行交换,我们得到了一个新的二进制数:1101100010000110它即是十进制的55430。这个问题用位操作... 阅读全文
摘要:
Description:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as000000101001010000011110100111... 阅读全文