七月三日
摘要:
sg输入法:面试官先拿一套卷子,1h时间答完,题量不大,1.一道程序题,写输出。n&(n-1)。。。求f(131),实际上是求n在二进制下1的个数。int f(int n) { int cnt = 0; while(n) { cnt++; n = n&(n-1); } return cnt;}2.单链表逆置,写代码3.也是根据程序写输出。f(1234),应该输出4320int f(int n) { int s = 0; do { s += n%10; n /= 1... 阅读全文
posted @ 2013-07-04 19:12 Ac_coral 阅读(297) 评论(0) 推荐(0) 编辑