Advertisement
mikhail_dvorkin

Java array example

Nov 22nd, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Temp {
  4.     public static void main(String[] args) {
  5.         Scanner in = new Scanner(System.in);
  6.         int n = in.nextInt();
  7.         int[] a = new int[n];
  8.         for (int i = 0; i < n; i++) {
  9.             a[i] = in.nextInt();
  10.         }
  11.         for (int i = 0; i < n; i++) {
  12.             System.out.print(a[i] + " ");
  13.         }
  14.         in.close();
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement