fork(5) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned int v = 0xCF31; // some number
  5. v = v - ((v >> 1) & 0x55555555); // reuse input as temporary
  6. v = (v & 0x33333333) + ((v >> 2) & 0x33333333); // temp
  7. unsigned int c = ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; // count
  8. printf("%u\n", c);
  9. return 0;
  10. }
Success #stdin #stdout 0.01s 1720KB
stdin
Standard input is empty
stdout
9