-------------------------------------------------------------------
经典问题7:c/c++ 程序设计 ---0、1串个数统计问题
-------------------------------------------------------------------
(1)面试题:下面程序的结果是多少?
1 #include <iostream>
2 #include <string>
3
4 using namespace std;
5
6 int main()
7 {
8 int count = 0;
9 int m=9999;
10 while(m){
11 count++;
12 m=m&(m-1);
13 }
14 cout<<"the count of the number 1 is:"<<count<<endl;
15 return 0;
16 }
------------------
$ ./a.out <