public class Solution {

// you need to treat n as an unsigned value

public int hammingWeight(int n) {

if(n==0)

{

return 0;

}

int count = 0;//记录1的位数

int m = 0;

while(n>0){

m = n&1;

if(m==1)

count++;

n = n>>1;

}

return count;

}

}

Why is my answer wrong？？