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. // your code goes
  13. int arr[]={1,2,7,-8,9,4,5,6,90,0,6,2,5,6};
  14. int max=-1;
  15. int count=0;
  16. for(int i=0;i<arr.length-1;i++)
  17. {
  18. if(arr[i]<arr[i+1])
  19. {
  20. count++;
  21. }
  22. else
  23. {
  24. count=1;
  25. }
  26. max=Math.max(count,max);
  27.  
  28. }
  29. System.out.println(max);
  30. }
  31. }
Success #stdin #stdout 0.11s 52660KB
stdin
Standard input is empty
stdout
4