package com.codegym.task.task07.task0710;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
To the top of the list
*/
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<String> list= new ArrayList<String>();
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
for(int i=0;i<10;i++){
String s= reader.readLine();
list.add(0,s);
System.out.println(s);
}//write your code here
}
}
package com.codegym.task.task07.task0710;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
To the top of the list
*/
public class Solution {
public static void main(String[] args) throws Exception {
ArrayList<String> list= new ArrayList<String>();
BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
for(int i=0;i<10;i++){
String s= reader.readLine();
list.add(0,s);
System.out.println(s);
}//write your code here
}
}