Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int N = scanner.nextInt();
- int[] array = new int[N];
- for (int i = 0; i < array.length; i++) {
- array[i] = scanner.nextInt();
- scanner.nextLine();
- }
- int currentLength = 1;
- int maxLength = 0;
- for (int i = 1; i < array.length; i++) {
- if (array[i - 1] < array[i ]) {
- currentLength++;
- maxLength= Math.max(maxLength, currentLength);
- } else {
- maxLength= Math.max(maxLength, currentLength);
- currentLength = 1;
- }
- }
- if(currentLength > maxLength){
- maxLength = currentLength;
- }
- System.out.println(maxLength);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement