Description
整數�n的同位元定義為:其二進位表示法中每位元的和再除以 2 的餘數。例如:21 = 10101 轉換為二進位後有三個 1,因此它的同位元為 1 或寫作 3 (mod 2)。
請撰寫一個程式,能夠計算某數�n的同位元。
The homobite of an integer � n is defined as the remainder of the sum of its bits in its binary representation divided by 2. For example: 21 = 10101 has three 1's when converted to binary, so its equivalent is 1 or written as 3 (mod 2).
Please write a program that can calculate the homobites of a certain number �n.
Input
輸入包含一個整數�n。
The input contains an integer �n.
Output
對於每個整數�n,請輸出:
The parity of B is P (mod 2).
B 是 n 的二進位表示法。
�
P 是 n 的二進位表示法中1的數量。
�
For each integer �n, please output:
The parity of B is P (mod 2).
B is the binary representation of n.
�
P is the number of 1's in binary notation of n.
�
Sample Input 1
60
Sample Output 1