public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> spicok = new ArrayList<String>();
int max = Integer.MAX_VALUE;
for (int i = 0; i < max; i++) {
String s = reader.readLine();
if (s.equals("end"))
{break;}
else
spicok.add(s);}
for (int i = 0; i < max; i++)
System.out.println(spicok.get(i));
}
}
package com.javarush.task.task07.task0722;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Это конец
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> spicok = new ArrayList<String>();
int max = Integer.MAX_VALUE;
for (int i = 0; i < max; i++) {
String s = reader.readLine();
if (s.equals("end"))
{break;}
else
spicok.add(s);}
for (int i = 0; i < max; i++)
System.out.println(spicok.get(i));
}
}