длинная строка
package com.javarush.task.task07.task0708;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Самая длинная строка
*/
public class Solution {
private static List<String> strings;
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int max = 0;
for(int i = 0; i < 5; i++){
// strings = reader.readLine(); //считываем строки
String s = reader.readLine();
strings.add(s);
// strings.add(reader.readLine());
int l = strings.get(strings.size()-1).length();
if(l > max){
max = l;
}
}
for(int i = 0; i < strings.size(); i++){
int l = strings.get(i).length();
if(l == max){
System.out.println(l);
}
else{
}
}
}
}