Module: (Python) 서브루틴: 프로시저 및 함수 - 2


Problem

3/8

숫자의 이진 표기법에서 단위 수

Problem

10진법으로 숫자 N이 주어졌을 때 이 숫자를 이진법으로 표현한 1의 수를 계산하는 함수를 작성하세요(0 <= N <= 106)
 
<헤드> <일># <몸>
입력 출력
1 255 8
Write the program below
N = int(input())
k = numberOfOnes(N)
print(k)     

     

Program check result

To check the solution of the problem, you need to register or log in!