daily pastebin goal
70%
SHARE
TWEET

Ex02PrintNum

a guest Feb 19th, 2019 65 in 152 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Tests;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Ex02PrintNumbers {
  6.     public static void main(String[] args) {
  7.  
  8.         Scanner sc = new Scanner(System.in);
  9.  
  10.         int num = Integer.parseInt(sc.nextLine());
  11.  
  12.         int[] arrayNum = new int[num];
  13.  
  14.         for (int i = 0; i < arrayNum.length; i++) {
  15.             arrayNum[i] = Integer.parseInt(sc.nextLine());
  16. //            System.out.println(arrayNum[i]);
  17.         }
  18.  
  19.         for (int i = arrayNum.length - 1; i >= 0 ; i--) {
  20.             System.out.print(arrayNum[i] + " ");
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top