Проверка на упорядоченность */ */с клавиатуры: дедушка бабушка ......... */ // Выводит: 1 public class Solution { public static void main(String[] args) throws IOException { //напишите тут ваш код ArrayList<String> list = new ArrayList<String>(); BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); for(int x=0; x<10; x++) { list.add(reader.readLine()); } for(int x=1; x<10; x++) { String z = list.get(0); if(list.get(x).length() > z.length()){ z = list.get(x); } else System.out.println(x); break; } } }