#include <cstdio> int main(){ int num, cnt=0, sh, yu; scanf("%d", &num); while(num != 0){ sh = num / 2; yu = num - sh * 2; num = sh; if(yu == 1){ cnt++; } } printf("%d", cnt); return 0; }
#include <cstdio> int main(){ int num, cnt=0, sh, yu; scanf("%d", &num); while(num != 0){ sh = num / 2; yu = num - sh * 2; num = sh; if(yu == 1){ cnt++; } } printf("%d", cnt); return 0; }