fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int[] liczba = new int[6];
  13. int[] tab = new int[8];
  14. liczba[0] = 8;
  15.  
  16. for(int j=0; j<tab.length; j++){
  17. tab[j]=liczba[0]%2;
  18. liczba[0]/=2;
  19.  
  20. System.out.printf("%d", tab[j]);
  21. //if (liczba[0] == 0) break;
  22.  
  23.  
  24.  
  25. }
  26. System.out.println("\n");
  27. }
  28. }
Success #stdin #stdout 0.04s 4386816KB
stdin
Standard input is empty
stdout
00010000