public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//write your code here
ArrayList<Integer> s = new ArrayList<Integer>();
for(int i = 0; i<10; i++)
{
s.add(Integer.parseInt(reader.readLine()));
}
for(int k = s.size(); k>=0; k--)
{
System.out.println(s.get(k));
}
}
package com.codegym.task.task07.task0719;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Display numbers in reverse order
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
//write your code here
ArrayList<Integer> s = new ArrayList<Integer>();
for(int i = 0; i<10; i++)
{
s.add(reader.readLine());
}
for(int k = s.size(); k>=0; k--)
{
System.out.println(s.get(k));
}
}
}