Advertisement
paranid5

7 11.11

Nov 11th, 2021
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.util.ArrayList;
  5. import java.util.Arrays;
  6. import java.util.Comparator;
  7.  
  8. import static java.lang.System.out;
  9.  
  10. public enum Main {;
  11.  
  12. private static final int SIZE = 300;
  13.  
  14. public static final void main(final String[] args) throws IOException {
  15. try (final var reader = new BufferedReader(new InputStreamReader(System.in))) {
  16. final var nums = new int[SIZE];
  17.  
  18. for (var i = 0; i < SIZE; i++)
  19. nums[i] = Integer.parseInt(reader.readLine().trim().replace(",", "."));
  20.  
  21. var ind = 0;
  22. var maxLen = 0;
  23.  
  24. while (ind < SIZE) {
  25. var len = 0;
  26.  
  27. while (ind < SIZE && nums[ind] % 2 != 0) {
  28. len++; ind++;
  29. }
  30.  
  31. ind++;
  32. maxLen = Math.max(maxLen, len);
  33. }
  34.  
  35. out.println(maxLen);
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement