Advertisement
Mariyan17320

gg

May 17th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class iliev {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int n = scan.nextInt();
  8.         int[] array = new int[n];
  9.  
  10.     }
  11.  
  12.         private static int seqnum(int[] array) {
  13.             int count = 1;
  14.             int max = 1;
  15.  
  16.             for (int i = 1; i < array.length; i++) {
  17.                 if (array[i] == array[i - 1]) {
  18.                     count++;
  19.                 } else {
  20.                     count = 1;
  21.                 }
  22.                 if (count > max) {
  23.                     max = count;
  24.                 }
  25.                 System.out.println(seqnum(array));
  26.             }
  27.             return 0;
  28.         }
  29.  
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement