fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. // your code goes here
  10. }
  11. static void monkey(int[] ar)
  12. {
  13. int index, temp,bad=1;
  14. Random random = new Random();
  15. while(bad==1){
  16. for (int i = ar.length - 1; i > 0; i--)
  17. {
  18. index = random.nextInt(i + 1);
  19. temp = ar[index];
  20. ar[index] = ar[i];
  21. ar[i] = temp;
  22. }
  23. bad=0;
  24. for(int i=0;i<ar.length-1;i++)
  25. if(ar[i]<ar[i+1]) bad=1;
  26. }
  27. }
  28. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Standard output is empty