// portable code to count the number of bits#include <;stdio.h>
int count(unsigned int x)
{ int n = 0; while (x > 0) { x = x&;(x-1); n = n + 1; }return n;
}

| عنوان | پاسخ | بازدید | توسط |
| |
0 | 3002 | admin |
| |
0 | 1857 | admin |
| |
0 | 3908 | admin |
| |
0 | 2226 | admin |
| |
0 | 2000 | admin |
// portable code to count the number of bits#include <;stdio.h>
int count(unsigned int x)
{ int n = 0; while (x > 0) { x = x&;(x-1); n = n + 1; }return n;
}