[ create a new paste ] login | about

Link: http://codepad.org/pVoQE3nt    [ raw code | output | fork ]

C++, pasted on Jan 25:
1
2
3
4
5
6
7
8
9
10
11
12
int main(){
uint32_t b = 159506;
int cnt=0;
bool chet=1;

for(int i=0; i<sizeof(b)*8; i++)
    if(b & (1ul<<i)) cnt++;
if (cnt & 1) chet=0;
printf("Единиц %d\n",cnt);
printf("Четность %d\n",chet);

}


Output:
1
2
3
cc1plus: warnings being treated as errors
In function 'int main()':
Line 6: warning: comparison between signed and unsigned integer expressions


Create a new paste based on this one


Comments: