@@ -0,0 +1,468 @@
+import java.util.Scanner;%0A%0Apublic class CountBitsOne %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scan = new Scanner(System.in);%0A%0A        int n = scan.nextInt();%0A        System.out.println(countPositiveBits(n));%0A    %7D%0A%0A    public static int countPositiveBits(int n) %7B%0A        int count = 0;%0A%0A        while (n %3E 0) %7B%0A            if ((n & 1) == 1) %7B%0A                count++;%0A            %7D%0A            n %3E%3E= 1;%0A        %7D%0A%0A        return count;%0A    %7D%0A%7D%0A

Solve homework2-problem7: Count of Bits One