#include long main() { FILE *fin,*fout; fin=fopen("bitcount.in","r"); fout=fopen("bitcount.out","w"); int n; int x=0; fscanf(fin,"%d",&n); while(n) { x=x+n%2; n=n/2; } fprintf(fout,"%d",x); return 0; }