2021-01-20 06:57:22 -05:00

24 lines
697 B
Java

import java.util.Scanner;
public class LabProgram {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int[] userList = new int[20]; // List of numElement integers specified by the user
int numElements; // Number of integers in user's list
// Add more variables as needed
int i;
numElements = scnr.nextInt(); // Input begins with number of integers that follow
/* Type your code here. */
for (i =0; i<numElements;i++){
userList[i] = scnr.nextInt();
}
for (i = numElements-1; i>-1; i--){
System.out.print(userList[i] + " ");
}
System.out.println();
}
}