알고리즘

1094 [시뮬레이션2]

ok4u 2019. 1. 7. 15:52

#include<stdio.h>

int main(){

    int n;

    int cnt=0;

    scanf("%d",&n);

    while(n!=0){

        if(n%2 == 1) cnt++;

        n/=2;

    }

    printf("%d",cnt);   

}


// 구현 !