析毫剖厘

来源:互联网 发布:办公软件2003下载 编辑:程序博客网 时间:2024/05/31 06:24

析毫剖厘

1000 - 1 = 0111

1000 & 0111 = 0

  1. int x = 999;
  2. int countx = 0; 
  3. while(x) 
  4.  { 
  5.     countx++; 
  6.     x = x&(x-1); 
  7.  } 
  8. cout << "countx:" << countx << std::endl;
原创粉丝点击