velio84

_07_CountOfBitsOne

Sep 8th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.23 KB | None | 0 0
  1. package Homework2;
  2. import java.util.*;
  3. public class CountOfBitsOne {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner sc = new Scanner(System.in);
  7.         int n = sc.nextInt();
  8.        
  9.         System.out.println(Integer.bitCount(n));
  10.  
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment