Home > Back-end >  Given an unsigned plastic, it how many 1 in the binary
Given an unsigned plastic, it how many 1 in the binary

Time:02-26

The problem of how to write C code ah

CodePudding user response:

 unsigned int x; 
Cin & gt;> x;
int count=0;
for (int i=0; I & lt; 32. I++)
{
If (x & amp; 1 & lt; count++;
}
Cout & lt; return 0;
  • Related