摘要: 1 import java.io.*; 2 3 public class TEST1 { 4 public static void main(String args[]) throws IOException 5 { 6 int count = 0; 7 byte buff[] = new byte[1024]; 8 count = System.in.read(buff); 9 String strings = new String(buff, 0, count);10 String stri... 阅读全文
posted @ 2013-10-12 16:06 铁甲小宝 阅读(392) 评论(0) 推荐(0)
摘要: 题目:将32位机上的无符号整数按位反转输出:例如:25,反转之后输出:2550136832代码: 1 #include 2 3 using namespace std; 4 5 6 void set_bit(unsigned int &num, int idx) 7 { 8 // 将num的从低位数第idx位赋值为1 9 // idx从0开始10 unsigned int tmp = 1;11 tmp = tmp > idx;21 tmp = tmp % 2;22 return tmp == 1;23 }24 25 int main()2... 阅读全文
posted @ 2013-10-12 10:42 铁甲小宝 阅读(573) 评论(0) 推荐(0)