Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ElmessTwo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String bord = scanner.nextLine();
- int first = 0;
- int sec = 0;
- String bord1 = bord.replace(" ", "");
- for (int i = 0; i < bord1.length() - 1; i++) {
- if(Character.isLetter(bord1.charAt(i)) || Character.isDigit(bord1.charAt(i))){
- first = 0;
- }else {
- first = first + 1 ;
- }
- if (first > sec ){
- sec = first;
- }
- }
- System.out.println(sec);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement