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 count = 0;
  13. int arrayN[]={9,8,4,3};
  14. do {
  15. int temp = 0;
  16. count++;
  17. for( int i = 0; i < (arrayN.length-1); i++) {
  18. if(arrayN[i] > arrayN[i+1]){
  19. temp = arrayN[i];
  20. arrayN[i] = arrayN[i+1];
  21. arrayN[i+1] = temp;
  22.  
  23.  
  24. }
  25. }
  26. } while (count<(arrayN.length));
  27. for(int i = 0; i < arrayN.length; i ++) {
  28. System.out.printf("%d", arrayN[i]);
  29. // System.out.print(k);
  30. }
  31.  
  32. }
  33. }
Success #stdin #stdout 0.1s 320320KB
stdin
Standard input is empty
stdout
3489