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. public class Main {
  8. public static void main(String[] args) throws IOException {
  9. int seqMax = 1;
  10. int seqCurrent = 1;
  11. int currentInt = Integer.parseInt(rd.readLine());
  12. for (int i = 1; i < 10; i++) {
  13. int nextInt = Integer.parseInt(rd.readLine());
  14. if (currentInt == nextInt){
  15. seqCurrent++;
  16. if (seqCurrent > seqMax) seqMax = seqCurrent;
  17. } else {
  18. currentInt = nextInt;
  19. seqCurrent = 1;
  20. }
  21. }
  22. System.out.println(seqMax);
  23. }
  24. }
Success #stdin #stdout 0.05s 2249728KB
stdin
112
11
11
11
1
2
2
3
3
4
stdout
3