public class Solution {
private static ArrayList<String> strings= new ArrayList() ;
public static void main(String[] args) throws Exception {
int lineL= 0;
int max = 0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int s = 0;
for(int i = 0; i<5; i++){
String b = reader.readLine();
Solution.strings.add(b);
}
for ( int i=0; i<5; i++ ){
String c = Solution.strings.get(i);
if(c.length()>max){
max=c.length();
lineL= i;
}
}
String joker = Solution.strings.get(lineL);
for( int i = 0; i<5; i++){
String sykaZaebalo = Solution.strings.get(i);
if(sykaZaebalo.length()==joker.length()){
System.out.println(Solution.strings.get(i));
}
}
}
}
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 ArrayList<String> strings= new ArrayList() ;
public static void main(String[] args) throws Exception {
int lineL= 0;
int max = 0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int s = 0;
for(int i = 0; i<5; i++){
String b = reader.readLine();
Solution.strings.add(b);
}
for ( int i=0; i<5; i++ ){
String c = Solution.strings.get(i);
if(c.length()>max){
max=c.length();
lineL= i;
}
}
String joker = Solution.strings.get(lineL);
for( int i = 0; i<5; i++){
String sykaZaebalo = Solution.strings.get(i);
if(sykaZaebalo.length()==joker.length()){
System.out.println(Solution.strings.get(i));
}
}
}
}