Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Exam_101_January_2016 - created by borkins on 2017-05-03.
- */
- import java.util.Scanner;
- public class _08_IncreasingElements
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- int len = 0;
- int maxLen = 0;
- int prevNum = Integer.MIN_VALUE;
- for (int i = 0; i < n; i++)
- {
- int num = Integer.parseInt(console.nextLine());
- if (num > prevNum) len++;
- else len = 1;
- if (len > maxLen) maxLen = len;
- prevNum = num;
- }
- System.out.println(maxLen);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment