fork download
  1. program salti;
  2. var D, q, r, count : int64;
  3. begin
  4. readln(D);
  5. q:=D; count:=0;
  6. while q<>0 do
  7. begin
  8. r:= q mod 2;
  9. q:=q div 2;
  10. if r=1 then count:=count+1;
  11. end;
  12. writeln(count);
  13. end.
Success #stdin #stdout 0s 5320KB
stdin
16
stdout
1