fork download
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.util.ArrayList;
  5.  
  6. public class Main {
  7. public static void main(String[] args) throws IOException {
  8. String[] input = reader.readLine().split("([ \t\r\n]|\\s)+");
  9. ArrayList<Integer> list = new ArrayList<Integer>(input.length);
  10. System.out.println();
  11. for(String s : input) {
  12. System.out.print(String.format("%11s", s));
  13. System.out.print(" ");
  14. int i = Integer.parseInt(s);
  15. System.out.print(s = String.format("%32s",
  16. Integer.toBinaryString(i)).replace(' ', '0'));
  17. System.out.print(" ");
  18. list.add(i = s.length() - s.replace("1", "").length());
  19. System.out.print(String.format("%2s", i));
  20. System.out.println();
  21. }
  22. System.out.println();
  23. for(int i : list) {
  24. System.out.print(' ');
  25. System.out.print(i);
  26. }
  27. }
  28. }
  29.  
Success #stdin #stdout 0.17s 321024KB
stdin
-151138 4 -1763853021 -19235 -127 -158074013 -52012 -126 -148499 16111631 -904353072 -105600 -9910344 -185739417 -3 9 9565027 -121 14546 -15 -1390 36670 -1740180049 13637 1470015 39461 15533 -18595 9 10127 1477591 -473 4308 -11 -444925 16929 44 12007 124 0 12224573 -17 -469171 6 -19 -663559675 -9328026 16485 -15431441 179068761 165184 -18235240 -106 -1103969743
stdout
    -151138 11111111111111011011000110011110 24
          4 00000000000000000000000000000100  1
-1763853021 10010110110111011011110100100011 19
     -19235 11111111111111111011010011011101 26
       -127 11111111111111111111111110000001 26
 -158074013 11110110100100111111101101100011 21
     -52012 11111111111111110011010011010100 23
       -126 11111111111111111111111110000010 26
    -148499 11111111111111011011101111101101 27
   16111631 00000000111101011101100000001111 14
 -904353072 11001010000110001010101011010000 13
    -105600 11111111111111100110001110000000 20
   -9910344 11111111011010001100011110111000 20
 -185739417 11110100111011011101011101100111 22
         -3 11111111111111111111111111111101 31
          9 00000000000000000000000000001001  2
    9565027 00000000100100011111001101100011 13
       -121 11111111111111111111111110000111 28
      14546 00000000000000000011100011010010  7
        -15 11111111111111111111111111110001 29
      -1390 11111111111111111111101010010010 25
      36670 00000000000000001000111100111110 10
-1740180049 10011000010001101111010110101111 18
      13637 00000000000000000011010101000101  7
    1470015 00000000000101100110111000111111 14
      39461 00000000000000001001101000100101  7
      15533 00000000000000000011110010101101  9
     -18595 11111111111111111011011101011101 27
          9 00000000000000000000000000001001  2
      10127 00000000000000000010011110001111  9
    1477591 00000000000101101000101111010111 13
       -473 11111111111111111111111000100111 27
       4308 00000000000000000001000011010100  5
        -11 11111111111111111111111111110101 30
    -444925 11111111111110010011011000000011 20
      16929 00000000000000000100001000100001  4
         44 00000000000000000000000000101100  3
      12007 00000000000000000010111011100111 10
        124 00000000000000000000000001111100  5
          0 00000000000000000000000000000000  0
   12224573 00000000101110101000100000111101 12
        -17 11111111111111111111111111101111 31
    -469171 11111111111110001101011101001101 23
          6 00000000000000000000000000000110  2
        -19 11111111111111111111111111101101 30
 -663559675 11011000011100101110001000000101 14
   -9328026 11111111011100011010101001100110 20
      16485 00000000000000000100000001100101  5
  -15431441 11111111000101001000100011101111 19
  179068761 00001010101011000101111101011001 16
     165184 00000000000000101000010101000000  5
  -18235240 11111110111010011100000010011000 17
       -106 11111111111111111111111110010110 28
-1103969743 10111110001100101100001000110001 15

 24 1 19 26 26 21 23 26 27 14 13 20 20 22 31 2 13 28 7 29 25 10 18 7 14 7 9 27 2 9 13 27 5 30 20 4 3 10 5 0 12 31 23 2 30 14 20 5 19 16 5 17 28 15